Quality stock photos for your creative or marketing needs. Photolibrary - We Get It


Graphic Design Forums: UK forums for graphic designers » Website Design Forums: » Website Coding & Programming Forum: » Javascript Help Pleeeeeeeeeease!

Reply
Old 06-18-2009, 03:45 PM   #1
Senior Member
 
andyd8's Avatar
 
Join Date: Jan 2009
Location: London
Posts: 124
Thanks: 11
Thanked 14 Times in 9 Posts
Cool Javascript Help Pleeeeeeeeeease!

I've created a toggle which works on rollover, so the user rolls over text and then information is displayed below it. The only problem is that if this is rolled over multiple times then the toggle opens and closes for how many times it was rolled over as opposed to just staying open or closing. I've posted the javascript below. Any help would be wicked, thanks.

Andy.

$(".open").hover(
function(){
$(this).next(".toggle").toggle(400);
return false;
},function(){
$(this).next(".toggle").toggle(400);
return false;
}
);
andyd8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
Reply With Quote
Old 08-04-2009, 07:06 PM   #2
Junior Member
 
Join Date: Aug 2009
Location: Ayrshire
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to leeboyce Send a message via Skype™ to leeboyce
Default

I could be wrong.

I'm assuming you want the 'toggle'ing item to apprear instantly when the person rolls over the text, and dissapear instantly when they exit from the text.

If that is the case, then, i think what you need to do is simple replace toggle(400) with toggle(0) as that is suggesting 400miliseconds are taken to complete the toggle action.

i.e.

$(".open").hover(
function(){
$(this).next(".toggle").toggle(0);
return false;
},function(){
$(this).next(".toggle").toggle(0);
return false;
}
);

This will make the change of state instant, which would remove the delayed effect i think you are experiencing.

Hopefully thats what your after.
leeboyce is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Twit this!
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Flyer Printing | Print Reseller Scheme | Graphic Design | Logo Designer | Web Design UK | Graphic Design UK | Letterhead Printing
Business Card Printing | UK Business Forum | Logo Designer | NCR Pads | NCR Books | Receipt Books | Drinks Coasters | A6 Flyers | A5 Leaflets
Web Design & Development | vBulletin Skins | Small Business Websites | Leaflets | Leaflet Printing | Web Design Liverpool | Invoice Books


DISCLAIMER: All posts on this forum express the views and opinions of the author only, not the owners, staff or advertisers, hence we will not be held liable.


Powered by vBulletin®
© Copyright Jelsoft Enterprises Ltd
SEO by vBSEO 3.2.0 RC5 ©2008, Crawlability, Inc.