Forum Replies Created
-
AuthorPosts
-
designdudesMember
Okay, so, it's been resolved. For anyone looking to give a shot themselves...
1) I downloaded the JS from CSS Tricks, see here: https://css-tricks.com/rethinking-dynamic-page-replacing-content/
2) In order for the script to work, you need to make sure you link jQuery and both script files (Minimizr and the custom dynamicpage.js script included in the download).
3) To get it to work specifically on your site, there are some CSS tags in the dynamicpage.js file that you're going to need to change. In particular for the StudioPress 411 theme, change every instance of...
"#main-content" to ".content"
"#page-wrap" to ".site-container"
"#guts" to ".entry"A couple of notes...
- To have it actually run the code based on the clicked link, I used this code instead of the provided code in dynamicpage.js, placed before the wrapper height calculation:$('.genesis-nav-menu a').click(function(){ _link = $(this).attr("href"); history.pushState(null, null, _link); loadContent(_link); return false; });
- I couldn't get the current-menu-item class to remove and apply to the new page's corresponding anchor tag. Since my design doesn't include a current-menu-item style difference, it's not a big deal to me, but in case that's something you want you should know you may need to dig a little more...
Here's the site with the working example, running Genesis 411 theme: http://designdudes.net
Cheers.
-
AuthorPosts