I am setting up JavaScript function call on page load:
$('.myMenu').affix({
offset: {
top: value
}
});
After some user interaction the value
getting changed and at the same time I am calling the code above again expecting that affix()
will be processing with a new offset
value, but it is not, it is still processing with initial value
what was on page load.
$(window).resize(function() {
$('.myMenu').affix({
offset: {
top: value
}
});
});
$(document).ready(function() {
$('.myMenu').affix({
offset: {
top: value
}
});
});
Why it is happening? may be some one could explain?
The windows resize triggering on windows resize I make sure that by using alert
function
I am using affix()
that is in the twitter bootstrap 3.0
and also I have the same problem with http://github.com/davist11/jQuery-One-Page-Nav plugin
$('.mainNav').onePageNav({
currentClass: 'active',
scrollOffset: offsetValue
});
onePageNav()
not applying a new offsetValue
if I do onePageNav()
on screen resize like above in case of affix()
.