Why my function not alert when load page [javascript]? -
why function not alert when load page [javascript]?
when scroll page it's alert work good.
when resize page it's alert work good.
but when load page why not alert ?
how can ?
$(window).load(function(){ $(window).on('scroll load resize', function () { alert("test"); }); });
why wrapping scroll
,load
, resize
operations in $(window).load(function(){});
when can directly call it. change snippet below, work window scroll
,load
, resize
.
$(window).on('scroll load resize', function () { alert("test"); });
Comments
Post a Comment