jquery - Same code with different values on the same page, when scrolltop -


I am not showing the whole code, it is integrated with the CMS custom tag, but here is the basic problem. I have the following scroll code:

  $ (function () {$ (window) .scroll (function () {var top = $ (document) .scrollTop (); if (top & Lt; 174) css ({top: '0', position: 'relative'}), $ ("# cssmenu> gtc: ul ul # cm-cur") AddClass (" Cm ("top ':' 0px ', position:' fixed '}), $ (" # cssmenu> gt; ul ul # cm-cur "). RemoveClass (" cm-cur "); // dropdown ul while scrolling Hide the menu}};});  

and the next one:

  $ ("#cssmenu gt gt # activate # drop") .mouseout (Function () {t = SetTimeout (function {$ ("li.cur-page # drop"). CSS ({background: '# EDF1F7'});}, 2000);});  

and I Trying to paste the code twice a second, using different values:

  $ (function () {$ (window) .scroll (function () {var top = $ (Document) .scrollTop (); if (top & lt; 174) $ (". Nav-wrap"). Css ({top: '0', position: 'AddClass ("cm-cur"), / To create a visible $ ("#cssmenu" gt li ul.active # drop) / dropdown menu, $ ("cssmenu" gt; Ul ul # cm-cur "") .mouseout (function () {t = setTimeout (function () {$ ("li.cur-page # drop"). CSS ({background: '# EDF1F7'});} , 2000);}); Else $ (".nav-wrap"). CSS ({top: '0px', position: 'fixed'}), $ ("# cssmenu> gtc: ul ul # cm-cur"). Hide the dropdown-ul menu during RemoveClass ("cm-cur"), // Scroll $ ("#cssmenu> ul li.active # drop") Mouseout (function () {t = setTimeout (function () {$ ("li.cur-page # drop"). CSS ({background: 'none'}), $ ("#cssmenu"> ul li ul # Cm-cur "). After the RemoveClass (" cm-cur "); // menu, this dropdown ul disapares, but with delay}}}}}}}};});  

This does not work


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -