[removed]how to write $(document).ready like event without jquery

后端 未结 7 1777
醉梦人生
醉梦人生 2020-11-27 04:19

in jquery $(document).ready(function) or $(function) , how could I do the same thing without jquery, and I need browser compatiable, and allow to attach more than one functi

7条回答
  •  甜味超标
    2020-11-27 04:58

    I have this after the 'close body' tag and before the 'close html' tag. and it works pretty well. The load presets function assigns width,height and position values to css div tags. useful for different screen sizes.

    document.onreadystatechange = function () {
    if  (document.readyState == "interactive") {
    loadPresets();
    }
    

    }

提交回复
热议问题