Home › Forums › JavaScript › Function not being updated correctly › Reply To: Function not being updated correctly
December 27, 2015 at 5:21 am
#236185
Alen
Participant
$(document).ready();
is a shorthand for $(document).on('ready', fn);
@xvilo in the demo you linked to, it looks like it’s doing what its suppose to do. No? In addition, you can pass an object to CSS instead of reaching for the DOM every single time.
$(element).css({
'width': divWidth,
'left': divPosit.left,
'top': divPosit.top,
'height': height,
'display': 'block',
});