Fancy Thumbnail Hover Effect w/ jQuery

Blog » CSS/XHTML » Fancy Thumbnail Hover Effect w/ jQuery

Fancy Thumbnail Hover Effect w/ jQuery

PrintApril 19th, 2009

Recently I was checking out some nice flash galleries and came across an effect that I really liked. I had a sudden urge to duplicate that similar effect but using my bread and butter (CSS and jQuery). I thought I’d share this and maybe some of you can find it useful.

Fancy Thumbnail Hover Effect w/ jQuery

Build the Foundation – XHTML

Our markup will be fairly simple, just an unordered three columned list.

<ul class="thumb">
	<li><a href="#"><img src="thumb1.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb2.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb3.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb4.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb5.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb6.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb7.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb8.jpg" alt="" /></a></li>
	<li><a href="#"><img src="thumb9.jpg" alt="" /></a></li>
</ul>

Dress it Up – CSS

Pay close attention to the positioning properties between the list item and the image. We have to make sure that the hovered image must be on top of the other images, so this part is key.

ul.thumb {
	float: left;
	list-style: none;
	margin: 0; padding: 10px;
	width: 360px;
}
ul.thumb li {
	margin: 0; padding: 5px;
	float: left;
	position: relative;  /* Set the absolute positioning base coordinate */
	width: 110px;
	height: 110px;
}
ul.thumb li img {
	width: 100px; height: 100px; /* Set the small thumbnail size */
	-ms-interpolation-mode: bicubic; /* IE Fix for Bicubic Scaling */
	border: 1px solid #ddd;
	padding: 5px;
	background: #f0f0f0;
	position: absolute;
	left: 0; top: 0;
}
ul.thumb li img.hover {
	background:url(thumb_bg.png) no-repeat center center;  /* Image used as background on hover effect
	border: none; /* Get rid of border on hover */
}

*Note – For more information about this property: -ms-interpolation-mode: bicubic, refer to Chris Coyier’s Bicubic Scaling fix for IE. For those who are using PNG files as the background, refer to my previous article, “PNG Transparency Fix in IE6“.

Bring it to Life – jQuery

Basically all we are doing is animating the thumbnail’s size, absolute positioning coordinates (vertical alignment w/ css), and padding when we hover over. During this animation, we also switch the value of the z-index, so that the selected image stays on top of the rest.

$("ul.thumb li").hover(function() {
	$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
	$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
		.animate({
			marginTop: '-110px', /* The next 4 lines will vertically align this image */ 
			marginLeft: '-110px',
			top: '50%',
			left: '50%',
			width: '174px', /* Set new width */
			height: '174px', /* Set new height */
			padding: '20px'
		}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

	} , function() {
	$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
	$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate({
			marginTop: '0', /* Set alignment back to default */
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '100px', /* Set width back to default */
			height: '100px', /* Set height back to default */
			padding: '5px'
		}, 400);
});

*Note – To learn more about Animation Queue Buildup, read “Quick Tip: Prevent Animation Queue Buildup” at www.LearnjQuery.com

Fancy Thumbnail Hover Effect w/ jQuery

Conclusion

It may not be as smooth as the flash version, but its definitely a neat effect. If you switch up the absolute potion coordinates, you can create various ways the hover effect pops out as well. If you have any questions or comments, please don’t hesitate to let me know!

Did You Enjoy This Post?

subscribeSubscribe via RSS ,by email, or by twitter to get all upcoming
tutorials and articles delivered straight to you.

Bookmark or Share this Post!

  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Twitter
  • E-mail this story to a friend!

Tags: ,

This entry was posted on Sunday, April 19th, 2009 at 11:08 pm and is filed under CSS/XHTML. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

196 Responses to “Fancy Thumbnail Hover Effect w/ jQuery”

  1. jérôme

    So perfect…

  2. otis

    ICE bro.

  3. chirag

    nice i will try

  4. chirag

    i see one prob in that

    when i hove 3 or 5 times to any image and then mouse out form that image is animation continue running so how can i stop it?

  5. Timothy van Sas

    Smooth effect!
    Thanks for the share

  6. Derrick

    Awesome! Now I really wish I had studied and know javascript and jquery. I need to.

    Thanks that was inspiring. Awesome indeed.

  7. Engelium

    Hi

    really great effect. I’ve a question: why do you repeat the center attribute here?

    ul.thumb li img.hover {
    background:url(thumb_bg.png) no-repeat center center;

    Tanks

  8. mathias

    nice effect, it will be useful to me. thx

  9. Steo

    Very good job, thank you for sharing your knowledge ;)

  10. Patternhead

    Cool tutorial. Nice effect.

    jQuery rocks :)

  11. Soh

    @chirag Good catch! I just updated it , please refer to .stop()

    @Engelium I decided to center the background so it sits evenly both vertically/horizontally behind of the thumbnail image :-) You can leave it at the default (left, top) but you would have to add padding precisely all around to allow the image to sit evenly~

  12. Hass

    awesome, thanks for sharing soh!

  13. Engelium

    Problably I’m missing something… but what does sets the first center and what the second?

    Sorry but I’m a bit perplexed about the use of 2 center…

  14. Soh

    Hey no worries Engelium, check this out :

    http://www.w3schools.com/css/pr_background-position.asp

    Let me know if that clears it up :-)

  15. Remkus

    Absolutely cool piece of code. I will HAVE to use this … somewhere :) I keep being amazed what jQuery can do. Thanks for releasing this code!

  16. Phoenix2life

    Very good. The demo worked smoothly in IE, FireFox and Chrome. This special effect comes interestingly in simpler manner. Few lines of code with manipulation of z-index and animating the thumbnail’s size, absolute positioning coordinates (vertical alignment w/ css), and padding. So cool. Thanks for sharing this nice tip.

  17. Engelium

    Tanks Soh :)

    I don’t use these methods to place elements so I ignored the use of the second value O_o

  18. Thomas Williams

    G’Day Soh – great tutorial!

    One comment: I noticed was when moving the mouse over several images, the animation starts playing on all the images I mouse over which utilises CPU (one solution might be to use the hover intent library).

    Cheers,

    Thomas
    http://theruntime.com/blogs/thomasswilliams/

  19. Andrea

    Thanks Soh, that’s very cool.. I was thinking it could be interesting to add also the option to open the images using a lightbox style gallery instead of loading them in the RHS container. It should be a quick one and could give designers another option.. what do you reckon?!

    Well done anyway, great job!
    Andrea

  20. chirag

    hai soh :)

    I get it .stop() point. this is gr8 tutorial.
    but do it some advance view
    like when i hover any tumb image

    “the right” side box this image comeout with fadeOn or animate etc any good effect of jQuery :)

    Thank you so much

  21. Gopal Raju

    Really awesome! Love the transition!

    Gopal Raju
    productivedreams.com
    twitter.com/gopalraju

  22. curtismchale

    Very cool piece of code. I’ve bookmarked it to use for larger images of products on the e-commerce store I’m building currently.

  23. Soh

    @Thomas Williams – that sounds very interesting, can you point me to a direction where I can learn about this? Thanks for the tip!

    @Andrea thanks for the suggestion, when I come around to this tut again I will def revamp it with a 2nd option :-)

    @all thanks for the feedback I’m glad you guys enjoyed it~!

  24. Gwóźdź Web designer

    So little code and nice effect. Really delightful made :-)

  25. masster

    Thank you for this post – realy cool! May I translate it in russian in my blog compupro.ru width backlink to this post?

  26. Soh

    @Masster, just as long as you cite/credit the site I’m all good :-)

  27. Thomas Williams

    Hi Soh – to use hover intent, add in the hoverIntent library from http://cherne.net/brian/resources/jquery.hoverIntent.html, then change the function call from:
    $(”ul.thumb li”).hover(function() {

    to
    $(”ul.thumb li”).hoverIntent(function() {

    The UI doesn’t quite feel as “snappy”, though, and might require some changes to the default hover intent time.

    Well done again on the great tutorial,

    Thomas

  28. Desizn Tech

    Hey really great post dude. Loving the Jquery !awesome keep up the good work

  29. dev.My

    Very nice effect. Like it

  30. Janko

    Nice effect, I like it!

  31. Alexandre Broggio

    Very cool effect thanks ….

  32. Soh

    Thank you for that info Thomas!! Looking into it now :-)

  33. Jason

    That is awesome – I have a project coming up that it may fit the bill for perfectly – thank you.

  34. sean

    so clean and clear (the code and the post)
    great work thank you for sharing.

  35. Steve

    That’s tight!

  36. Paulo

    Very cool work, thanks

  37. Niklas

    Clean, slick and cool. Thank you!

  38. Marco

    Great neat little effect – looks pretty awesome, well done!

    Just one small question: How did you add the “shadow” around the active image – Can’t seem to find it.

    Anyway, keep up the good work!

  39. Tim

    Very nice effect. Cleanzorvilles. I likey.

  40. Soh

    @Marco It’s actually just a background image, check it out below :-)

    ul.thumb li img.hover {
    background:url(thumb_bg.png) no-repeat center center; /* Image used as background on hover effect
    border: none; /* Get rid of border on hover */
    }

  41. Dainis Graveris

    Very interesting tip, definitely gonna try it out! Thanks!

  42. andrew

    Great article man thanks for showing how this is done really cool.

    ~Cheers

  43. Dirk

    Love this one, barely finished reading your article and I had this running in no time on my site on http://www.digizaal.nl/photos/zoomer/
    thanks you so much !!!
    greetings from Amsterdam.

  44. JR

    first awesome write up. I’m pretty much been self teaching (well more like stealing) web design / wordpress for the last month.

    second, i got a quick (very noob) question… the jquery section.. would it be best to add to the existing jquery core (and how would I do it without messing that file up) or make a new jquery file (and if you have have one already that would be awesome)

    last… thanks again for the tutorial and also any help you can throw my way.

  45. Soh

    @JR I usually reference an external js file (leaving the core file as is).

  46. iPad

    Oh my dear GOD! This is so amazing Soh, I have to try this…

    #bookmarked

  47. Maicn

    Beautiful in simplicity. very good and clean code.

  48. gtraxx

    Good evening, I took your idea by creating a jQuery plugin to get a similar effect.
    My plugin will soon be online, I send you first ;-)
    Thank you very much

  49. gtraxx

    I uploaded the plugin based on your script, I said the link to the original script from your page.
    I invite you to test it, you can see I have added effects.
    view plugin in jQuery officiel plugin : http://plugins.jquery.com/project/magical
    Projects : http://magicalhover.clashdesign.be/
    Supports and comment : http://magix-cjquery.com/post/2009/05/01/un-joli-rollover-sur-vos-images-avec-jQuery

    Best regards

  50. cipek

    nice

  51. John

    Great tutorial, does anybody know where to find a tutorial that does this effect? http://soupstudios.com/ I can’t seem to find anything. Basically need it to do exactly as it shows on here, when you hover over a link it displays a prominent image in an anchored stationary fashion. Need to have the ability for that image to be linkable as well.

  52. Michael

    Loving this tut! It’s a sweet effect but I am having a problem. I have images that have 2 different widths, 100px and 56px. How would I pass the width of the image to the css property in the jquery?

    url: http://www.michaeladamek.com/pictureseffect.php?url=chuck

    Thanks!

  53. jopicar

    Cool, thanks for sharing :)

    Kind regards ;)

  54. Ploy

    Wow! This tutorial is very easy to understand! I love the hover effect, so cool! :D

  55. deviantz

    perfect! very nice tutorial! thanks for sharing this!

  56. Virani

    This can also be accomplished using CSS3’s scale property and the :hover pseudoclass .on Modern Browsers. No JS would be required.

    For exmaple, see: http://www.zurb.com/article/221/css3-animation-will-rock-your-world

  57. Anuj

    hi its very nice. i will try.

  58. Anuj

    I think, i will try to take a call to put in our site.

  59. eddie

    hi
    can you make another effect(something like the effect here) in this website http://www.ciriljazbec.com/#/commercial/
    (it use Flash,and i try my hard to do it use jQuery,but i fail)

  60. Swinge

    very nice!!!!!!

    can it be done in mootools?

  61. Dave

    Very great stuff !
    Maybe a noob question, but is it possible to have the thumbs linked to a flashplayer ?
    Each thumb is a screenshot of a videofile which plays on a flash player when we click it… That’d be awesome…
    Thanks again

  62. ScriptPlazza

    Very nice !
    GOOD JOB!

  63. sandeep

    Don.t try but not bad

  64. Cristian

    Is possible to link each image of the Main View with a url?

  65. Soh

    Dave and Cristian, yes you can but I feel that should be another tutorial on its own so I can elaborate on each concept.

    If you would like to get a hint of how it will be done, check out Nick La’s jQuery tutorial on the “Image replacement gallery”.

    Its pretty much the same idea but you would be declaring a variable for your youtube video ID (for Dave), and for Cristian, you would be adding one for your external link.

  66. kamal

    Hi ,

    Very nice effect for Mozilla, don’t work in IE 6 as smooth, Please check

  67. Cristian

    Soh, thanks for the advice:

    Making this change in the code: works, but not in Internet Explorer

    //Swap Image on Click
    $(”ul.thumb li a”).click(function() {

    var mainImage = $(this).attr(”href”); //Find Image Name
    var url = $(this).attr(”title”);
    $(”#main_view img”).attr({ src: mainImage, onClick : “window.open(’” + url +”‘);” });
    // $(”#main_view img”).attr({ src: mainImage, onClick : “location.href=’” + url +”‘;” }); //

    return false;
    });

    });

    Another pendient “bug” is include the hand icon over the image area….

  68. Creative24

    Hi Soh,

    Awesome jQuery – thanks for sharing!

  69. Creative24

    Doesn’t work on IE6 though…any fix? :-(

  70. Soh

    @Creative24, it does work in IE6 :-)

  71. Alexx

    пасибо классный скриптик!

  72. lorenz

    Hey there – great little tute, exactly what I was looking for (almost!). Was wondering if this can be done with divs instead of li – then we can put in other block-level HTML as well (paragraphs and such) that will also zoom. What do you think?

  73. Madhab

    really its a good one

  74. madhab

    hi, its a a really good one, but here my expectation is little bit more, is that possible text also show with the image when going to mouse over?

    I am waiting for your reply.

  75. Steve

    These effects are sweet

  76. Shaaa

    Cool. This is an awesome work…

  77. Ruud

    Briliant work!

    But does anyone know how to display text in the main div after clicking a thumbnail instead of just a bigger image?

  78. Maverick

    this is really very impressive….. well presented.

    thanks for the script though.

  79. Dodi

    just see it, and impress by it… great tutorial, thanks ;)

  80. Soh

    madhab & Ruud, you can try using a combination of this tutorial and the image rotator with teaser tutorial for that effect: http://designm.ag/tutorials/image-rotator-css-jquery/

  81. rakhi

    nice

  82. Wario

    This is a great article and in fact a great site. I’m going to take some some and go through some of your other blog posts.

  83. chalama

    That was really helpful. Thanks!!

  84. Samia

    Hey, it’s a great post. Thanks a bunch for sharing this.I’ve used this in the site currently i’m working. I’m really new at this and was wondering if I could ass some text that would appear under the thumbnail when the mouse will be hovered. Any help?? Thanks in advance and cheers to yours great posts.

  85. mapa mapy slovenska

    Great one!!!

  86. güvercin

    its very cool ;)

  87. Hung Bui

    Really nice post and great effect on thumbnail images. Cheers!

  88. xjr13sp

    Hi

    Very nice effect!
    Could you tell me how can I get the backgroung image “thumb_bg.png”?

  89. Tony

    This is a great creation, I have been toying with it but I am having bad luck with resizing the thumbnails. I wish to use a larger grid of images (6×7) with each of them being 51×51 pixels, and the problem comes up when the images are moused over the location that they move is not working the way that I thought it would. I can’t get a live version of this up yet to see but if this is at all understandable can someone let me know what to adjust to basically “scale” everything down proportionally?

  90. Tony

    has anyone tried using this with images flowing into a gallery from flickr?

  91. DJSHAANO

    Your are simply,… Great!

    You are now in my inspirations,………… ;)

  92. Mayur

    This effect is very essential to any image gallery. It can improve any site, thanks for posting it! I was using a template located at: http://www.dcarter.co.uk/photography_1.html, and wanted to apply the effect to the existing gallery. Any Tips? What would help is a file that can be downloaded, which shows what files are needed and how they are linked in HTML. I used DreamWeaver, and this may be a stupid question, but do I need an extension? I just learned the basics of HTML and CSS this weekend, and need help with JQuery…

    Thanks!

    Mayur

  93. Martin

    Hey, very sweet effect. I was wondering if it is possible to link to a HTML page? I tried this:

    //Swap Image on Click
    $(”ul.thumb li a”).click(function() {

    var mainImage = $(this).attr(”href”); //Find Image Name
    var url = $(this).attr(”title”);
    $(”#main_view href”).attr({ src: mainImage, onClick : “location.href=’” + url +”‘;” });
    return false;
    });

    });

    I don’t want to SHOW the HTML in the div but only link to another page.

    Thanks

  94. Martin

    Ok I’ve got it:

    //Swap Image on Click
    $(”ul.thumb li a”).click(function() {

    });

    });

    Thats it ! :)

  95. Key
  96. Grant

    Beautiful!

    Can anybody help me place a title under a thumb and also the larger hover image?

    So:

    Thumb image
    Title/name

    HOVER

    Larger image
    Title/name

    Anyone please? Thank you :)

  97. zabogar

    nice…..

  98. Grant

    Hi. Probably a 5 minute job for some-one who knows what they’re doing. I’m willing to pay. $20-$30 USD? Anyone please? My question above.

  99. pc_clown

    NICE!
    used it on 1 on my sites and love it.

    1 question thou… Is there a way to meke the hovered pic display on full size?

    cheers

  100. Soh

    @pc_clown If you mean you want it to blow up in full size, it may not be so wise to do so. We are basically loading the max-size image as default, so if you have a lot of hi-res full screen images it will def slow down your page load time. Perhaps a lightbox plugin is a better solution for you~

    http://leandrovieira.com/projects/jquery/lightbox/

  101. pc_clown

    your right,

    cheers mate…

  102. Mali

    Hey Bub, this looks cool from the demo: http://www.sohtanaka.com/web-design/examples/image-zoom/ – so no more waiting for shockwave file to finish download but mine seems to work, I’m still a beginner – can I save with extension? Cheers:) MALI

  103. Yigit Ozdamar

    Amazing!

  104. Janvier

    I have many heroes in life. Man can I put you on the list? Actually I already have.. nice effect man!

  105. Tom

    THANK YOU!

  106. Rashidi Landbrug

    Okay if you want to add a link to your thumbnail this is what you do

    add this little code at the end of your script:

    $(”.thumb li img”).click(function(){window.location=$(this).find(”a”).attr(”href”); return false;});

    and insert in the href=”" the link of your choice

    and that all send me a little message if this works out for you or if you just used this

  107. Ben

    Looks amazing! Really clean and easy to use. My only problem is that when I plug my pictures in and I click them it links to a new page and displays them. How did you make it so that when you click the image it just replaces the image in the main view? Mine goes to a whole new page.

  108. Ben

    ^ Edit: Nevermind, I didn’t have the correct version of jquery in my code. /facepalm

  109. ardianzzz

    WoW! its amazing… thanks for sharing.. this stuff what i want!!!

  110. Iflexion

    Really beautiful. Thanks for sharing the source code.

  111. Tim

    The amazingly good thing is that it clean and easy to read

  112. Mukesh

    Excellent. Thanks for sharing the source code.

  113. kobs

    thanks ^^

  114. Sara

    Wow! So cool effect! I LOVE IT! Thank you so much! :)

  115. Ag'

    So nice, it’s simple and smooth, and the effect is just great. Thanks !

  116. Peter Repta

    I love when I see such innovative works… nice.

  117. Kane Sojka

    Great tutorial! Thanks also to Thomas for the hoverIntent() info. It works really well in conjunction with this tutorial.

  118. Bournemouth

    This is just what I’ve been looking for!!
    THANKS. Great tutorial!

  119. min

    At the moment if I get the external URL link to work, the hover zoom effect won’t work. And if the image hover zoom effect works as per the codes provided, the external links won’t work… hmm.. this is a little frustrating and as a noob I’m unable to solve it after 4 hours.

    has anyone managed to figure the script for both functions to work effectively??

    still, thanks a ton for sharing this with us all…

  120. Soh

    Are you talking about the external link on the thumbnail image or the main preview image?

    the thumbnail image has a return false; which would ignore any action assigned to that link by html.

  121. min

    thanks so much for that tip, soh. that just did it!!! not sure why i didn’t notice that before..
    :D

  122. elpedro

    Dont work in explorer though, cant get it to work on this site either in your example page, any idea why?

    PS.
    Work like a charm in firefox.

  123. elpedro

    Got it to work with explorer, couldnt run this script with some other jQuery scripts on the page, working now, thanks for your time.

  124. Matt

    Great job on this Soh!

    I was wondering if it’s possible to also change a text URL when the image is swapped. So if I click image 2, a text URL would change to “url2″, click image 3, text URL changes to “url3″, etc.

    Thanks again, this is awesome!

  125. ดูหนังออนไลน์

    It’s amazing!!

    thanks.

  126. jerrygo

    Very nice effect!thans

  127. Hadza

    nice effect. But there is problem, when the zooming image is decreasing back to original size, the other image around(right and under) it jump in front. That is not pleasant.

    It can be helpful this page http://justinfarmer.com/?p=31

    function() {
    /** $(this).css({’z-index’ : ‘0′}); //there is bad timing**/
    var objectLi = $(this);
    $(this).find(’img’).removeClass(”hover”).stop()
    .animate({
    marginTop: ‘0′,
    marginLeft: ‘0′,
    top: ‘0′,
    left: ‘0′,
    width: ‘100px’,
    height: ‘100px’,
    padding: ‘5px’
    }, 400, function(){ //callback function to make css run AFTER shrink
    $(objectLi).css(’z-index’,'0′);
    }
    );

    cia Hadza

  128. Sribanta Kumar Sahoo

    Thanks a lot !!This is really very useful article.I used it and it works fine.

  129. George

    I’m normally a big fan of lightshow picture view, but that’s not bad.

    Very very cool :)

  130. eric

    Could you do the same thing (blow-up when hovering) for a whole div?

  131. RemAd

    Hi Soh. It’s amazing. Thanks for sharing this.

    I’d like to use Lightview on my web site:
    http://www.nickstakenburg.com/projects/lightview

    Unfortunately there is a conflict between your script and the script used by Lightview:

    http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js

    Can You give me a hint solving this problem.
    Thank You!

  132. Ayaz Malik

    hiiz, well from all the comments it seems like im the only person who isnt able to get it to work O_O im not sure why. i accurately copy pasted. changed image links etc. but nothing. i thought it wud be confcliting with java scripts of my site so did it in a new file but its still the same. is there any js file which is to be linked to html file except the jquery code given above ?
    Regards

  133. Neo

    Same here too. Seems like all people above except you and me, Ayaz. I create 3 small image and use the css style, I link my html file to the .css and .js. The css controls the image pretty good (pull all the photo appearing as list in back onto one row) but the .js file does not work at all? If anyone has a full demo project and share with us (me and Ayaz), we will appreciate that!

  134. Myth

    Great little app!

    I was wondering if their was a way to adjust the alignment of the boxes? Sometimes I end up with an odd number of boxes and it would look soooo much nicer if I could center them horizontally.

  135. james

    not working………Please help
    I placed all the codes the place where they were to be place but the images are not magnifying

  136. aki

    nice! cool! so cool! like it!

  137. SoSo

    This is what to do if you want to put links on other page on the thumbs…

    //Swap Image on Click
    $(”ul.thumb li a”).click(function() {
    window.location = $(this).find(”a”).attr(”href”); //Find Image Name
    $(”#main_view img”).attr({ src: mainImage });
    return false;
    });
    });

  138. Chiefs Hockey

    Dude, u r a genious! Thanx for inspiration,
    Chiefs Hockey

  139. clk

    Quick question from a noobie pasta coder… Why do I lose the href mouse click when the hover is activated? Can get link to open with right click and middle click but not mouse click?

    Any thoughts or hints would be grand… I tried googling but I really don’t know what to google for… lost hyperlink when jquery hover activates?

  140. Eugene

    Hey, great work.
    I was wondering if the thumbnails will have to be fixed in the width and height?

    Could it be used for images of random sizes?

  141. Soh

    @Eugene – If you have them at different sizes you will have to calculate the absolute positioning coordinates according to your image. That would be your only hurdle~

  142. Soh

    @clk, I think your talking about the link not clicking through when its on hover over.

    I responded to a similar question above: “the thumbnail image has a return false; which would ignore any action assigned to that link by html.”

    So if you are trying to link out on the active thumb, just delete “return false;” and you should be good to go~

  143. ovidiu

    hi there.
    this is exactly what I was looking for. is there maybe a wordpress plugin for this?
    if not, I udnerstood most of the instructions, except the jquery part. where does that code go? is it a javascript? do I have to add the javascript tags around it and load it on the page I need it?

  144. ovidiu

    I need this implemented on a certain page on a wordpress blog for 3 images. exactly as seen in the demo here. anyone willing to help out for a small donation?

  145. chiangmai guide and tour

    great. it smoot and butiful. when it implement in gallery to views sample images.

  146. ovidiu

    ok, I got it working but something is still wrong: the images, popping up, are kinda below my navigation menu thus not compeltely visible. here is the test implementation I did: http://021club.co.za/

  147. ovidiu

    made some mroe progress: http://021club.co.za/ but I have problems because the opening image doesn’t seem to be allowed to overlap the ul :-( had to remove the float left from the li elements, as I want them centered…

  148. Soh

    If you want the hover to be centered, you have to make sure you apply your vertical/horizontal alignment (top: 50%, left: 50%, margin: -xx 0 0 -xx;

    Also to make sure your hovers stay on top, just be sure to raise your z-index~

  149. ovidiu

    thx. for the hints.
    I already tried raisign the z-index to 10000000 but still, the popping up image, is kinda restricted to the height I gave the ul container. if I take the height away from it, it resizes itself too small :-(

    I didn’t float: left the li’s beacuse I want them centered… so I use display: inline for the li’s .

    appreciate any hints, jsut have a look at the link above please…

  150. Soh

    Try seeing what happens when u add the float back in. I know sometimes absolute positions don’t work when there is no float. I would get it to work like the tutorial first, then start cutting back and customizing. This way you know which line of code is causing your bug~

  151. ovidiu

    hey, I tried so but no chance :-( check it out: http://021club.co.za/

    got actually 2 problems:

    - the popping up image, pops out of the screen (on the right)
    - it simply can’t manage to break out of that ul :-(

    I think tis got to do with the theme I am using, would you please, please have a look at this link and see if you see anything unusual? been debugging with firebug now for hours :-(

  152. Kostas

    Super!!!

  153. bonny

    Greate!I’ll copy to my blog:http:www.iebe.cn

  154. Ziggy

    Looks awesome. Nice job.

  155. ahmet

    greate

  156. ดูหนังออนไลน์

    thanks so much for that tip.

  157. prince-albert

    Nice , a really good job !! I really like it
    But …
    I like to do this kind of behaviour with the open source Prestashop engine.
    a e-commerce platform.
    Is there anybody who have any experience to share ??
    thanks every body

  158. Chris

    I love this effect! I’m actually using it with some other effects. I’m adding it to a slider and a transparent image name rolls up from the bottom of the image. Gonna be sweet!

    Thanks for the foundation!!! :)

  159. Dipesh

    Hi,

    How can i give different links to all different images?

    thanks in advance :)

  160. Anup

    Thanks man nice script and it saved my ass………….

    Thanks once again…………..

  161. n3mo

    awesome , dude ;)
    Nice tutorial.
    Thanks!

  162. Blockstopper

    Hiya,

    Daft question, but how do you actually download the thumb_bg.png?

    cheers,

    Blockstopper

  163. Kourosh

    Hi,
    very nice but is it possible to have it within a new ticker?

    i have tried but no success.

    Have any idea how?

  164. Blockstopper

    hiya,

    I managed to get the background image downloaded.

    I’m now actually looking to have the effect with just a single image, instead of a ..My (PRE HOVER) image is already correctly styled, so I just need to apply the hover effects to it.

    Has anyone done it with just a single image?
    I’d appreciate the advice.

    Thanks,

    Blockstopper

  165. jake

    Good day can you please tell me where to download the code for this that is working so that I can edit it and play with the code….I am really new in using jquery. I dont know where to start or where to paste the code that you posted. thank you in advance.

  166. Renko

    Is there a way to put some kind of description under each images ?

  167. dogboy

    Great tutorial. I was having similar problem trying to get the hovered thumb to click through to an external URL, your reply to delete “return false;” was the simple solution. Wish I’d read it before googling the problem for an hour.

  168. indialike

    Very nice and useful tutorials to web designers,
    Thanks for posting.

  169. Mac

    Hi,
    Any one can help me to show the caption title under the hover image.
    Please provide any solution!
    Thanks
    Mac

  170. anders

    I love your site.
    I really like Jquery with the simplistic and quick loading features becasue really web sites are fast and jam packed with traffic if driven correctly

  171. tina

    Awesome plugins dude. I’ll definitley use for my portfolio. thanks for code

  172. Key

    I am currently using this script to show my website portfolio (the images are all one size). But I also have another part of my portfolio where there are many different sized images. I was wondering if there was a way to have the thumbnail be a cut off version of the full image, or a percentage or the image, and then the rollover shows the image full size.

    Any help would be greatly appreciated. I love this code and would like to use it through the rest of my portfolio.

    Thanks, Key

  173. AcuraNSX

    If I have 20+ picture wanna to show by using this gallery, issit possible to have thumbnail pages like simpleviewer to have several pages for the thumbnails?

  174. i-cute

    Like this method very much and ive tried and combine it with jquery caption. It works pretty smooth but i still dont know how to make each main view a link? do i need to repeat the id? thanks ;)

  175. Web Tasarım Fiyatları

    Wow! So cool effect! very nice ..
    I love this site.

  176. tozebaiao

    Guys, I need help on this script.
    When my page comes up the main image does not show by default, shows only when I click the thumb.

    Does anyone knows what the problem is? Apart from this, is a great scrit.

    RGDS

    TZ

  177. Ronen

    Thanx Soh,

    Really cool & clean script.
    Works well with drupal as well!

  178. YC

    So how would you adjust the javascript file if your images are inside of an images folder?

    The script works if everything is in one folder, but I typically organize my images in their own folder and when I try to test this script I am unable to get the main image to swap.

    Tanks to anyone who is able to assist me!

  179. Amen Moja Ra

    Hey I know I am late to the JQuery mania but I love this tutorial and all the markup and javascript worked. A lot of tutorials out there don’t have good markup and JavaScript.

  180. osvy

    how do I use this on a php page?

  181. Robert

    Wondering if anyone has done anything like this with YouTube? I morphed the example into this.

    http://www.tradica.com/20100211/

    Thanks for the tutorials,
    -R

  182. Atasözleri

    Wonderful effect in gallery! Thank you very much!

  183. Rajinder Singh

    This is a good effect.

  184. RageVortex

    Hey mon really useful stuff. I work for an educational institution and was smashing my head to the monitor looking for a way to make the “mac-ish type icons” and this tutorial helped me make it work for the site I was working on. I posted the html here http://ragevortex.0fees.net/macicons/iconstest.html if anyone else needs it. It’s only fair you were a great help. It’s a little crude but it served its purpose I hope you guys like it.

  185. Soulast

    Hey…
    Im not sure how to make thumbs working as the link this way so on clinck it will page will open in new tab or site did try place target=”_blank” but didnt worked for me.

  186. gossip girl

    So Beautiful !!!

    Great work !

  187. Chris

    Great effect and I’m trying to incorporate something similar into my site, however everytime I try and change the image source in the XHTML it crashes my Dreamweaver?

    Any ideas how to stop this so I can put my own thumbnails in!?

  188. RageVortex

    Hey Soulast -

    The version I made for my school’s site has the “_target” code and works … I’d check the thing again maybe there’s a typo somewhere mon.

    Example:

    <a href="link" target="_blank"><img src="iconimage.png" alt="Icon Name" width="70" height="70" border="0" title="Icon Description for mouseover" /></a></dd>

  189. Soh

    For those trying to allow the thumb to actually click through, just delete return false; and it will naturally follow the link.

  190. Wasif

    this is awesome, thumbs up for your website and this little application in particular.

  191. Chris

    Maybe I am missing something. But what the trick when using thumbnails that are a different size than 100×100 pixels? Is there a formula for choosing the right margin sizes for animation?

    Also, when I use a thumbnail larger than 100px, Safari freaks out on the mouseout animation. Do you know what is causing this?

  192. Ajit

    You can use this for clicking image to URL.

    //Swap Image on Click
    $(”ul.thumb li a”).click(function() {
    $(”#main_view img”).attr({ src: mainImage });
    window.location=$(this).find(”a”).attr(”href”); return false;
    return false;
    });
    });

  193. SoccerGuy3

    Sweet script. Gonna give it a spin right now. Any thoughts on implementing a title upon enlargement? The title would only show on the large image.

  194. SheilaQ

    Good morning,
    First of all — great work — love the effect(s). I’ve been playing around though for several days now (I really know nothing about jquery) trying to implement showing the caption under the one larger view of an image (not under the thumbnail). I’d like to pull the title from the img src line for each image used and have the caption change dynamically under just the large image. If anyone has been able to make this happen, I’d sincerely appreciate seeing the code you added to make it work. Thanks so much! P.S. I don’t have the website address showing yet, as the page is not yet active/published.

  195. Xcellence IT

    Thanks for this work.. I got it work on my current project.. the impact is awesome…

    Thanks

  196. ziz

    why is no play in ie??
    i cant do that…

Speak Your Mind…

Need to post HTML code?
Use Postable for your convenience.

Don't have an Avatar?
Set up a Gravatar image now!

Blog Blog Categories

Popular Comments Popular Posts

Recent Comments Recent Comments