weena
Members
-
Joined
-
Last visited
Reputation Activity
-
weena reacted to mantis in Wordpress one page website with anchor type pagesYou basically need to bind to the scroll event like so :
// Cache selectors var topMenu = $("#top-menu"), topMenuHeight = topMenu.outerHeight()+15, // All list items menuItems = topMenu.find("a"), // Anchors corresponding to menu items scrollItems = menuItems.map(function(){ var item = $($(this).attr("href")); if (item.length) { return item; } }); // Bind to scroll $(window).scroll(function(){ // Get container scroll position var fromTop = $(this).scrollTop()+topMenuHeight; // Get id of current scroll item var cur = scrollItems.map(function(){ if ($(this).offset().top < fromTop) return this; }); // Get the id of the current element cur = cur[cur.length-1]; var id = cur && cur.length ? cur[0].id : ""; // Set/remove active class menuItems .parent().removeClass("active") .end().filter("[href=#"+id+"]").parent().addClass("active"); }); I found that here if you need to look further but it should work provided you style the "active" class like you would your .current_page_item
I'm not sure I understand the second part of your question. Do all your links have the .current_page_item class then? Otherwise can you inspect it to find out where the blue highlight is coming from?
-
weena reacted to teodora in Wordpress one page website with anchor type pagesjQuery waypoints is one way of doing it - maybe have a look at http://webdesign.tutsplus.com/articles/create-a-sticky-navigation-header-using-jquery-waypoints--webdesign-6408
hth
-
weena reacted to levan in Looking for a Web DesignerHi everyone,
I'm WordPress Theme developer. I'm looking for a designer for developing WordPress templates and selling them on ThemeForest together. If anyone is interested, let me know.
E-mail: levangabeskiria@gmail.com
Best Regards,
Levan