I'm currently making a navigation with .active class as the user scrolls, but the first anchor doesn't have an .active class unless you will scroll. Anyway, it's quite hard to explain.
Please check this fiddle: http://jsfiddle.net/7nrLU/5/
Feel free to suggest other better way, but not CSS3. Thank you!
-
You could put $('.navigation a.a1').addClass('active'); inside document ready, before $(window).bind(...?Alex Ball– Alex Ball2012-06-26 06:49:04 +00:00Commented Jun 26, 2012 at 6:49
-
Can't you just put the class in the markup?Musa– Musa2012-06-26 06:49:26 +00:00Commented Jun 26, 2012 at 6:49
-
@AlexBall, thanks you! It works. Musa, I think it's better if jquery will do that =)user1441816– user14418162012-06-26 06:55:21 +00:00Commented Jun 26, 2012 at 6:55
-
@user1441816, I am happy that it works, I post as an answer :-)Alex Ball– Alex Ball2012-06-26 07:14:52 +00:00Commented Jun 26, 2012 at 7:14
Add a comment
|