Mark Forums Read
  #1  
Old 09-05-2011, 08:16 AM
amankumar amankumar is offline
Senior Member
 
Join Date: Jul 2011
Posts: 146
amankumar is on a distinguished road
Default Problems with Jquery image hover

Hi. I'm trying to make a jquery image hover and it's working fine(I think) but I'm just puzzled as to how to achieve the effect I want. Greyed out thumbnail turns to colour on hover, clicking it changes the img.background then I want the thumbnail to remain in colour, as if "selected". Like I said, my code works but the problem is when you mouse out of the thumbnail, because of the first bit of code it switches back to the greyed out version. I can't figure out how to stop it or what other way I could be doing it in the first place.
$(".thumbnails img").hover(function(){
this.src = this.src.replace("-b","-a");
}, function() {
this.src = this.src.replace("-a","-b");
});


$(".thumbnails img").click(function(){
imgurl = this.src.replace("thumb-a", "bg")

$("img.background").attr({
src: imgurl
})

this.src = this.src.replace("-b","-a");


});
Reply With Quote
 #Add to Ads's Reputation  
OldSponsored Ads
Ads AdsPromoter is online
Member
 
Join Date: LongTime
Posts: 1100
Ads is on a distinguished road
Default New Sponsored Ads



This message will go away once you are registered. Also, by registering, you will have access to all post topics, communicate privately with other members (PM), respond to polls, upload graphics, and access other special features! Registration is fast, simple and absolutely free so please Click Here to join our Web Hosting community today!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 03:54 PM.


Powered by vBulletin Version 3.6.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.4.0