jquery - Change ul style on scroll to div -


i have menu 4 <ul>s , in container of page have 4 boxes. first ul first box, second ul second box, third ul.... , goes on

when scroll first box first ul's style change different style, when scroll second box second ul's style change same different style , first ul's style return original style.. , that.

the problem when scroll last box, fourth ul style change different style, when pause box , goes space without boxes fourth ul's style still same style , not return it's original style can see here:

http://ge.tt/6ycyz1h/v/0

i tried (http://ge.tt/6peky1h/v/0) didn't work 100% can see. explained things , where's problem in codes. codes here: http://jsfiddle.net/yzvkx/

not sure if still looking answer problem here fiddle.

you can use jquery add , remove classes change style of button.

$(".scroll").click(function (event) {     $('#menu li').addclass('menutext');     event.preventdefault();     $('html,body').animate({         scrolltop: $(this.hash).offset().top - 59     }, 800);     $(this).parent().removeclass('menutext');     $(this).parent().addclass('menutext2'); }); 

here fiddle. http://jsfiddle.net/yzvkx/1/


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -