atagrup

Making an Interactive Picture with jQuery

24 Kasım 2009 Salı



1. This tutorial will show you how to set up the basic structure for your own interactive picture.
2. Create/Position “more info” buttons
3. Add captions to buttons
4. Link buttons to descriptions in popup info boxes

This tutorial will be most effective if used as a guide to customize the downloadable files.
Set Up Your Picture
http://buildinternet.com/2009/11/making-an-interactive-picture-with-jquery/


Demo | Download



Set Up Your Picture

Before we can place any buttons, we first have to get the image ready (I’ve chosen a picture of our office) . Let’s make the div #picture, which will act as our canvas.
  1. #picture{ position:relative; top:20px; width:700px; height:466px; margin:0px auto; background:#FFF url('office.jpg'); overflow:hidden; }  
You will want to customize your dimensions and background image to match your selected image. Everything we will be doing will take place inside of this div tag.

Positioning Info Buttons

If you’ve taken the time to check out the live demo, you’ve probably also noticed the large “+” buttons scattered throughout the picture. These buttons are going to be the foundation of what we do, acting as markers within the image.
That being said, here is the HTML structure of a sample button, complete with comments to explain it.
  1. <div class="more" id="couch"> <!-- id refers to specific item -->  
  2. <a href="#"><img src="more.png"/></a> <!--defines button image, don't change link -->  
  3. <span>IKEA Klippan Couch</span> <!-- The caption for the button -->  
  4. </div>  
Each button pulls from a few CSS styles, the first is the general button styles, which you probably won’t have to customize much/at all.
  1. /* General More Button */<span style="white-space: pre;"> </span>  
  2. .more{ position:absolute; width:50px; height:50px; background:url('dim.png'); border:1px solid #444; padding:5px; text-align:left; overflow:hidden; }  
  3. .more span{ position:absolute; left:60px; width:160px; padding:15px 0 0 5px; color:#FFF; font:bold 13px Lucida Grande, Arial, sans-serif; text-shadow:#000 1px 1px 0px; }  
The second bit that affects a button is the unique CSS that positions the button over the corresponding area of the image.
  1. /* Item Specific More Button */  
  2. #couch{ top:240px; left:75px;}  
Using this structure you can make as many buttons as you need for your image. We will be revisiting the buttons again in the jQuery section, where we will make the captions appear on hover.

The Info Box

When a visitor clicks any of the buttons, we want an info box to pop up from the bottom with the additional information inside. When this box pops up, the background should dim to call attention to the info box (I have done this before in my Lights Out tutorial).
The HTML for this goes as follows:
  1. <!-- Info Boxes -->  
  2. <div id="infobox">  
  3. <span class="close"><a href="#"><img src="close.png"/></a></span>  
  4. <br/>  
  5. <div id="couch_info">  
  6. <img src="klippan.jpg"/><br/>  
  7. <a href="http://www.ikea.com/us/en/catalog/products/10138530">IKEA Klippan Couch</a>  
  8. </div>  
  9. </div>  
  10. <!-- Dimmed Background -->  
  11. <div id="fade_bg">&nbsp;</div>  
The CSS for this positions the info box in the dead center of the image, slaps a close button in the upper right, and covers the background in the semi-transparent png which dims the background. (Note: This will all be triggered by jQuery, so it will not show up yet)
  1. /* General Info Box */  
  2. #infobox{ position:absolute; bottombottom:-200px; left: 350px; height:200px; width:300px; z-index:20; margin:0 0 -100px -150px; background:#FFF; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; }  
  3. #infobox a, #infobox a:visited{ font:italic 16px Georgia, serif; color:#555; text-decoration:none; }  
  4. #infobox a:hover{ text-decoration:underline; }  
  5. span.close{position:absolute; rightright:5px; top:5px;}  
  6. #fade_bg{ position:absolute; z-index:15; width:100%; height:100%; background:url('dim.png'); display:none;}  

Bringing It Together with jQuery

There is a bit a jQuery involved, so here’s the breakdown – ready, set, go.
This removes the dotted blue lines in all browsers when links are clicked.
  1. //Blur Links (Prevents Outline)  
  2. $('a').click(function() {  
  3. this.blur();  
  4. });  
In order to trim down the amount of markup, we are using the same info box for all the descriptions, and hiding the ones not in current use. This line runs through and hides all of the divs contained #infobox by default when the page loads.
  1. //Hide all item descriptions in the info box  
  2. $("#infobox > div").css("display", "none");  
When a button is clicked, the info box gets triggered and slides in from the bottom. The dimmed background also fades in to view and we end the function by returning false so the link is not actually executed.
  1. //Call in the info box  
  2. $(".more a").click(function(){  
  3. $("#infobox").animate({bottom: '233px' }, 300);  
  4. $("#fade_bg").fadeIn();  
  5. return false;  
  6. });  
The info button expands to show it’s caption when the visitor hovers over it. Here you can customize the exact width it expands/retracts to. To prevent overlap between buttons, the button that is hovered over gets a high z-index temporarily.
  1. //Expand more info button on hover  
  2. $(".more").hover(function(){  
  3. $(this).stop().animate({width: '225px' }, 200).css({'z-index' : '10'});  
  4. }, function () {  
  5. $(this).stop().animate({width: '50px' }, 200).css({'z-index' : '1'});  
  6. });  
An example of a item description display function – you will need to duplicate this function for each button you have. This displays the correct item description in the info box when it slides into view.
  1. //Show description for selected item  
  2. $("#couch a").click(function(){  
  3. $("#couch_info").show();  
  4. });  
When the dimmed background or close button gets clicked, the info box and background disappear and the descriptions are again all hidden.
  1. //Remove background, info box and hide all descriptions  
  2. $("#fade_bg, .close").click(function(){  
  3. $("#fade_bg").fadeOut();  
  4. $("#infobox").animate({bottom: '-200px' }, 300, function() {  
  5. $("#infobox > div").css("display", "none");  
  6. });  
  7. return false;  
  8. });  

Final Product

I would strongly suggest using the downloadable files as a launching point, as it is easier to customize them for your own purposes rather than go from scratch. Lastly, I hope you enjoyed this tutorial and find it useful for a future project.

Phyto Free Wordpress Themes



Demo | Download
Priority support with theme install/setup and customizations available for $35-$100.Contact Us
Brown colored wordpress theme with two widgetized sidebars and a widgetized footer.

Features

  • Adsense Ready
  • Sidebar and header ad management
  • Social icons
  • Twitter support
  • Threaded comments
  • Contact form
  • Page Management

Shopping Press Free Wordpress Themes



Preview | Download Theme Url

Shopping Press is elegant design free premium WordPress theme. Suitable for any niche especially for shopping, fashion and entertainment web sites. Options page at admin panel.
Features:

  • Options Page
  • Featured Content
  • 125×125 banners ready (easy editable from admin options)
  • Two columns
  • Gravatar on Comments
  • Compatible with latest WordPress versions
  • Widgets Ready
  • SEO Optimized
  • Fixed width
  • Logo .PSD file and font files are included in theme folder.
  • Tested and compatible with all major browsers: IE, FF, Safari
Admin Options Features:
  • Featured Content
  • Logo image
  • Twitter
  • 125×125 pixels banners
  • Sidebar Ads/Banners
  • Header and Footer script codes

Selecta Free Wordpress Themes



Specifications

* Width 960px
* Columns 2
* Layout Center
* Colors 6
* Wordpress 2.8


Features More Details

* Widgetised Home Page
* Ajax Comments
* Feature Post Slider
* Threaded Comments



Demo | Download

http://www.obox-design.com/

New flash component: Continuous Image Slider



Using this image slider you can display a continuous loop of images, with direct links to other sections in your website. The images can be randomized so that every time the slider loads, it displays a different set of images.

Every image can have it’s own link, and width. You can set the images in the XML, as well as the component width and height, if used within another AS3 Flash file.

If you use the component inside a website, you can set the component width and height in the HTML.
Features:

1. Optional HTML text description.
2. Customizable colors.
3. Optional random display of images.
4. Continuous image loop.


Demo | Download

http://blog.flabell.com/985/flabell-new-product-continuous-image-slider

jQuery miniZoomPan plugin

23 Kasım 2009 Pazartesi

Durante la fase iniziale dello sviluppo di un widget jQuery un bel pò più articolato, mi sono ritrovato al punto in cui offset().left e top, ed il loro utilizzo erano chiari; ho quindi deciso di condividere con voi questi ‘effettini’ trasformandoli in un piccolo plugin con funzionalità di Zoom e Pan (ingrandimento e scroll in base alla X e Y del puntatore del mouse).


Si chiama miniZoomPan e funziona così: si prepara il markup composto da una DIV con un ID e dentro ci si mette un’immagine; la classica immagine in un post, per esempio.


 
<div id="zoom01"> 
    <img src="leaf_s.jpg" /> 
</div> 

Si instanzia il plugin (scaricabile qui) in questo modo:

 
$(function() { 
        $("#zoom01").miniZoomPan({ 
        sW: 200//small image width and height 
        sH: 250
        lW: 370//large image width and height 
        lH: 462 
        // other options 
        /* 
        frameColor: "#cecece", 
        frameWidth: 1, 
        loaderContent: "loading..." // text or image tag eg.: "<img src='spinner.gif' />" 
        */
 
    }) 
}); 


Fatto. Come potete notare sW e sH sono le dimensioni dell’immagine piccola, mentre lW e lH sono quelle dell’ingrandimento. Obbligatoriamente le vs. immagini dovranno avere la parte finale del nome file modificato ad hoc (mycat_s.jpg per la piccola, mycat_l.jpg per la grande).


A questo punto quando vi posizionate sull’immagine, ne viene caricata una di dimensioni maggiori (grande quanto volete) che scrollerà in base alla posizione del mouse. Un preload customizzabile con testo o con una gif informa l’utente del caricamento in corso.

Qui trovate la pagina d’esempio, dove con un minimo di pazienza potrete recuperare il CSS e lo script che comunque per comodità potete prelevare rispettivamente qui e qui. Si tratta di piccolo plugin senza pretese, che però può servire su un online store per visualizzare al volo l’ingrandimento di una maglietta o di un oggetto senza dover cambiare pagina o usare finestre modali.

miniZoomPan plugin. Enjoy.



http://www.gcmingati.net/wordpress/2009/06/18/jquery-offset/

NewsTime Free Wordpress Theme



README Document :




Installation:

1.Upload NewsTime to wp-content/themes
2.Upload get-recent-comments to wp-content/plugins
3.Go to wp-admin and activate newstime theme.
4.Activate get-recent-comments plugin.
5.Enjoy posting !

==================================================

Edit menu:

Open header.php and find – line 47,modify link overthere with your links.
- line 85,modify link overthere with your links.

Edit footer link:

Open footer.php and find line 11.

To edit ‘BLOGROLL,FEATURED VIDEO,ADS’ go to sidebar.php

==================================================

License

You can:

- Edit the theme
- Delete BLOGROLL link
- You can add your credits on footer.

You can’t:

_ Delete my copyright from footer
- You can’t add your credits and delete main.
- Redistribute the theme without my agreement.

If you want to delete my copyright contact me at ‘alleeex@yahoo.com’.


Demo | Download

Official Signs & Icons Ultimate Symbol Collection




Official Signs & Icons Ultimate Symbol Collection
26MB | 1410 EPS Design Images of High-Quality | RAR | RS.com



-Vol. 1 Highway Signs I: U.S.
(Manual of Uniform Traffic Control Devices)
-Vol. 2 Highway Signs II: International
(United Nations Conference on Road Traffic)
-Vol. 3 Symbol Signs: Recreational
(Society of Environmental Graphic Design)
-Vol. 4 Symbol Signs: Transport I
(American Institute of Graphic Arts/Department of Transportation)
-Vol. 5 Symbol Signs: Transport II
(Transit Cooperative Research Program / Americans with Disabilities Act)
-Vol. 6 International Icons: Electronic Labeling


http://rapidshare.com/files/310099297/Official.Signs.Collection.rar

BRounded – Professional Blogger Layout for free download

21 Kasım 2009 Cumartesi

FancyPlayer Revisited – jQuery Fancybox and Flowplayer