Stromgren Posted March 31, 2012 Share Posted March 31, 2012 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 comment Share on other sites More sharing options...
dsonesuk Posted March 31, 2012 Share Posted March 31, 2012 jquery not problem, css margin left 770px is the problem, in #jsddm li ul {} Link to comment Share on other sites More sharing options...
Stromgren Posted March 31, 2012 Author Share Posted March 31, 2012 Once again youre the best dsonesuk Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.