Closed HenkBarreveld closed 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.
Hello Thomas, No problem, here is an example: video
This is what I did:
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.
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 👍
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!
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 likejQuery(window).on('load scroll resize orientationChange', function () {
to cover other actions, in addition toscroll
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.