Ad:
 
Similar Threads
Apr 7th, 2010
0

jquery dropdown help

Expand Post »
Hi all, i have this function, it slides down a div #dd_about and stays down until i click on the body, is there a way to keep the div down until i move from the div and not click? Im new to jscript and jquery thanks.

Any help is appreciated

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <div id="dd_b"><a href="softball.php"><img src="images/nav/softball_btn.png" alt="Softball" width="125" height="25" border="0" id="softball_btn" onmouseover="chgImg(this.id,1)" onmouseout="chgImg(this.id)" /></a>
  2. <div id="dd_bout">
  3. <ul>
  4. <li><a href="softball.php#camps">Camps &amp; Clinics</a></li>
  5. <li><a href="softball.php#completeplayer">Compleye Player</a></li>
  6. <li><a href="softball.php#eliteregional">Elite Regional</a></li>
  7. <li><a href="softball.php#lilstars">Lil Stars</a></li>
  8. <li><a href="softball.php#training">Training Facility</a></li>
  9. </ul>
  10. </div>
  11. </div>
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var timeId;
  2. function blank(){
  3. }
  4. $(document).ready(function(){
  5. $('#dd_a').mouseover(
  6. function(){
  7. $('#dd_about').slideDown(300);
  8. }
  9. );
  10.  
  11. $("body").click(function(){$('#dd_about').slideUp(300);});
  12. });
Reputation Points: 10
Solved Threads: 0
Newbie Poster
apollokid is offline Offline
11 posts
since Feb 2009
Apr 8th, 2010
0

Re: jquery dropdown help

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. $("#dd_a").mouseout(function() { $('#dd_about').slideUp(300); });
  2.  
  3. // or
  4.  
  5. $('#dd_a').hover(
  6. function() {
  7. $('#dd_about').slideDown(300);
  8. },
  9. function() {
  10. $('#dd_about').slideUp(300);
  11. }
  12. );
Sponsor
Featured Poster
Reputation Points: 145
Solved Threads: 274
Posting Virtuoso
pritaeas is offline Offline
1,639 posts
since Jul 2006
Apr 8th, 2010
0

Re: jquery dropdown help

Hey Pritaeas, that technically works but... The #dd_about div rolls up when i go to click on the links, is there something i can incorporate into the code to keep the div showing until i roll out from dd_about?

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
apollokid is offline Offline
11 posts
since Feb 2009
Apr 9th, 2010
0

Re: jquery dropdown help

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. $("#dd_about").mouseout(function() { $('#dd_about').slideUp(300); });

Don't know your positioning, so you may have to tweak this example with the previous one.
Last edited by pritaeas; Apr 9th, 2010 at 3:41 am.
Sponsor
Featured Poster
Reputation Points: 145
Solved Threads: 274
Posting Virtuoso
pritaeas is offline Offline
1,639 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: 'array' is undefined?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: insert new line after diplaying each key value pair in javascript object





About Us | Contact Us | Advertise | Acceptable Use Policy
Build Custom RSS Feed


Follow us on Twitter


© 2010 DaniWeb® LLC