ThemeAwesome / WP-Forge

WP-Forge - A Foundation for Sites WordPress Theme
https://themeawesome.com/wp-forge-wordpress-foundation-for-sites-theme/
85 stars 28 forks source link

contain-to-grid menu option #49

Closed HenkBarreveld closed 8 years ago

HenkBarreveld commented 8 years ago

contain-to-grid.js offers a nice and simple way, together with some styling, to make the topbar (div.contain-to-grid) sticky.

However, I think it will be better to replace jQuery(window).on(scroll function() { by something like jQuery(window).on('load scroll resize orientationChange', function () { to cover other actions, in addition to scroll that could influence the position of the topbar.

As it is now, a window reload while the topbar is fixed, will cause the topbar to disappear.

tsquez commented 8 years ago

I am really not sure what you are referring to when you say

As it is now, a window reload while the topbar is fixed, will cause the topbar to disappear.

I've never experienced that. Could you provide me with a screenshot or a link to an example?

Thanks again.

HenkBarreveld commented 8 years ago

Hello Thomas, No problem, here is an example: video

This is what I did:

tsquez commented 8 years ago

OK I tried what you said and I see what you are referring to, however where do you see the following:

jQuery(window).on(scroll function() {

it isn't in contain-to-grid.js and it isn't in any of the theme files of WP-Forge. Could you be a little more specific as to where you saw this? That would be very helpful.

Thanks again.

tsquez commented 8 years ago

Nevermind, I found it, well not exactly it...lol...I was looking for the exact phrase you referenced, but it is in contain-to-grid-sticky.js and I added your suggestion and it works like a charm 😃

I'll make this part of the next update. Thanks again amigo for the suggestion. Great work 👍

HenkBarreveld commented 8 years ago

Hello Thomas, I was indeed referring to jQuery(window).scroll(function() { in the file contain-to-grid.js; not jQuery(window).on(scroll function() { (which would not even work :-)) Sorry for the confusion!