Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Function not being updated correctly Reply To: Function not being updated correctly

#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',
});