Home › Forums › JavaScript › Function not being updated correctly › Reply To: Function not being updated correctly
December 27, 2015 at 6:49 am
#236192
Participant
@shikkediel didn’t know that was being removed. Just shows how much I’ve been working with jQuery, mostly using VueJS.
@xvilo I’ve replicated your issue by creating locally:
index.html
and copy your markupdemo.html
so I can navigate between pages (same markup)- added following JavaScript (re-wrote some parts)
$(document).ready(function() {
calcLeftWrapper();
});
$(window).resize(function() {
calcLeftWrapper();
});
function calcLeftWrapper() {
var $original = $('.original-width');
var $divWidth = $original.width();
var $divPosit = $original.offset();
var $vph = $(window).height();
var $element = $('.leftwrapper');
var $height = $vph - $divPosit.top - 15;
$element.css({
'width': $divWidth,
'left': $divPosit.left,
'top': $divPosit.top,
'height': $height,
'display': 'block',
});
}
Everything is working as expected.
Hope that helps,
Alen