Best Complimentary Jquery Css Ikon Hover Upshot Demos & Plugins



Free jQuery CSS Image Hover Effects amongst y'all that is pretty adept Best Free jQuery CSS Image Hover Effect Demos & Plugins

Today i am going to share  Free jQuery CSS Image Hover Effects amongst y'all that is pretty good.I came across quite a lot of CSS gallery websites that using huge thumbnail to showcase beautiful websites. Some of them are only ordinary thumbnail, but a lot of them select javascript animated caption to bring to a greater extent than data to viewers. In this tutorial, nosotros volition acquire how to brand ordinary thumbnail to something more. This is my 2d tutorial well-nigh thumbnail gallery, if y'all missed the showtime one, y'all powerfulness desire to read it after -Downloading in addition to demo links are given below. i equally good select given measuring past times method of using this.

1. HTML

  1. <div class="zitem">
  2.     <a href="#"><img src="1.jpg" alt="Test 1" title="" width="125" height="125"/></a>
  3.     <div class="caption">
  4.         <a href="">Test 1</a>
  5.     </div>
  6. </div>
  7. <div class="zitem">
  8.     <a href="#"><img src="2.gif" alt="Test 2" title="" width="125" height="125"/></a>
  9.     <div class="caption">
  10.         <a href="">Test 2</a>
  11.     </div>
  12. </div>
  13. <div class="zitem">
  14.     <a href="#"><img src="3.png" alt="Test 3" title="" width="125" height="125"/></a>
  15.     <div class="caption">
  16.         <a href="">Test 3</a>
  17.     </div>
  18. </div>

2. CSS

I select added inline comment inward the next CSS code. If y'all desire to acquire to a greater extent than well-nigh CSS, read my previous post 15 CSS Tips in addition to Tricks or, y'all desire to know MORE ABOUT CSS, read my novel transportation service - 15 Ways to Optimize CSS in addition to Reduce CSS File Size
  1. .zitem {
  2.     width:125px;
  3.     height:125px;    
  4.     border:4px solid #222;    
  5.     margin:5px 5px 5px 0;
  6.     
  7.     /* required to cover the ikon after resized */
  8.     overflow:hidden;
  9.     
  10.     /* for small-scale fry absolute seat */
  11.     position:relative;
  12.     
  13.     /* display div inward trouble */
  14.     float:left;
  15. }
  16. .zitem .caption {
  17.     width:125px;
  18.     height:30px;
  19.     background:#000;
  20.     color:#fff;
  21.         
  22.     /* cook it at the bottom */
  23.     position:absolute;
  24.     bottom:-1px; /* cook IE number */
  25.     left:0;
  26.     /* cover it past times default */
  27.     display:none;
  28.     /* opacity setting */
  29.     filter:alpha(opacity=70); /* ie */
  30.     -moz-opacity:0.7; /* former mozilla browser similar netscape */
  31.     -khtml-opacity: 0.7; /* for actually truly former safari */
  32.     opacity: 0.7; /* css standard, currently it industrial plant inward most modern browsers similar firefox, */
  33. }
  34. .zitem .caption a {
  35.     text-decoration:none;
  36.     color:#fff;
  37.     font-size:12px;    
  38.     
  39.     /* add together spacing in addition to brand the whole row clickable*/
  40.     padding:5px;
  41.     display:block;
  42. }
  43. img {
  44.     border:0;
  45.     
  46.     /* let javascript moves the img position*/
  47.     position:absolute;
  48. }

3. Javascript

This is a uncomplicated jQuery script amongst hover effect. What nosotros select to create is calculate the width in addition to tiptop in addition to laid it to the image.
  1.     
  2. $(document).ready(function() {
  3.     //move the ikon inward pixel
  4.     var deed = -15;
  5.     
  6.     //zoom percentage, 1.2 =120%
  7.     var zoom = 1.2;
  8.     //On mouse over those thumbnail
  9.     $('.zitem').hover(function() {
  10.         
  11.         //Set the width in addition to tiptop according to the zoom percentage
  12.         width = $('.zitem').width() * zoom;
  13.         height = $('.zitem').height() * zoom;
  14.         
  15.         //Move in addition to zoom the image
  16.         $(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
  17.         
  18.         //Display the caption
  19.         $(this).find('div.caption').stop(false,true).fadeIn(200);
  20.     },
  21.     function() {
  22.         //Reset the image
  23.         $(this).find('img').stop(false,true).animate({'width':$('.zitem').width(), 'height':$('.zitem').height(), 'top':'0', 'left':'0'}, {duration:100});    
  24.         //Hide the caption
  25.         $(this).find('div.caption').stop(false,true).fadeOut(200);
  26.     });
  27. });




0 comments: