Jump to content

jQuery dropdown menu problems


Recommended Posts

Hello allI found a dropdown menu which i am using in the top right corner of this site: http://byvejen.dk/lb/But after i moved the code around a bit it stopped working and i cant find the error. Im not that sharp with jQuery yet.Heres the script:

<script type="text/javascript">var timeout		 = 500;var closetimer        = 0;var ddmenuitem	  = 0;function jsddm_open(){    jsddm_canceltimer();    jsddm_close();    ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');}function jsddm_close(){    if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}function jsddm_timer(){    closetimer = window.setTimeout(jsddm_close, timeout);}function jsddm_canceltimer(){    if(closetimer)    {    window.clearTimeout(closetimer);        closetimer = null;}}$(document).ready(function(){    $('#jsddm > li').bind('mouseover', jsddm_open);    $('#jsddm > li').bind('mouseout',  jsddm_timer);});document.onclick = jsddm_close;</script>

And heres the HTML:

<div id="header">    <div class="container">        <div class="columns">		    <div class="logo">			    <h1><a href="http://byvejen.dk/lb/">LejeBasen.dk</a></h1>		    </div>		    <div class="nav">			    <ul>				    <li><a href="http://byvejen.dk/lb/">Hjem</a></li>				    <li><a href="index.php">Kategorier</a></li>				    <li><a href="index.php">Lej</a></li>				    <li><a href="index.php">Udlej</a></li>			    </ul>		    </div>		    <div class="search">			    <form enctype="text" action="index.php">				    <input type="text" name="searchfield" id="searchfield" value="Søg produkter" />				    <select name="landsdel" id="landsdel">					    <option selected="selected" id="choose">Landsdel</option>					    <option id="Osted">Osted</option>				    </select>				    <input type="submit" name="search_submit" id="search_submit" value="SØG" />			    </form>		    </div>		    <div class="profile">			    <ul id="jsddm">				    <li><a href="#">Casper Strømgren</a>					    <ul>						    <li class="min_profil"><a href="#">Min profil</a></li>						    <li class="rediger_profil"><a href="#">Rediger profil</a></li>						    <li class="rediger_annoncer"><a href="#">Rediger annoncer</a></li>						    <li class="mine_udlejninger"><a href="#">Mine udlejninger</a></li>						    <li class="mine_bookinger"><a href="#">Mine bookinger</a></li>					    </ul>				    </li>			    </ul>    		    </div>        </div>    </div></div>

Any hints towards a solution is apprecieted :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...