Side navigation
#13618 closed feature (plugin)
Opened March 16, 2013 07:44PM UTC
Closed March 16, 2013 07:52PM UTC
Last modified March 16, 2013 11:12PM UTC
Feature request: $(window).loaded(function(){...});
| Reported by: | trusktr | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.9.1 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
$(window).load(function(){...}); works fine for doing things after the window is loaded when the event fires, but unlike $(document).ready(function(){...}); it does not fire if it is executed after the window is loaded. For example, $(document).ready(function(){...}); will execute even after the window is already ready.
Can you make a $(window).loaded(function(){...}); feature that would be have just like $(window).load(function(){...}); but it could be fire any time after the window is loaded?
Attachments (0)
Change History (2)
Changed March 16, 2013 07:52PM UTC by comment:1
| resolution: | → plugin |
|---|---|
| status: | new → closed |
Changed March 16, 2013 11:12PM UTC by comment:2
For fun and profits (tm):
$.windowLoaded = $.Deferred(function( defer ) {
$( window ).load( defer.resolve );
}).done;
// Usage
$.windowLoaded(function() {
// Works before and after the event
});
Untested but should do the work ;)
This isn't a common need. You could do it easily yourself by setting a flag or create a plugin to do it.