Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#7143 closed bug (fixed)

1.4.3rc1: .resize() doesn't work

Reported by: alec Owned by:
Priority: high Milestone: 1.4.3
Component: event Version: 1.4.2
Keywords: resize Cc:
Blocked by: Blocking:

Description

I've got in body onload a function which executes followed code: $(window).resize(function() { alert('aa'); }); $(window).resize(); In 1.4.3rc1 resize event is not fired (no alert). No javascript errors. The same in FF, Opera and Chromium.

Change History (7)

comment:1 Changed 9 years ago by addyosmani

Resolution: worksforme
Status: newclosed

Please see here for a cross-browser test case of the above that uses $(body).append rather than console or alert (just to ensure you can see that the event is being executed): http://jsbin.com/imofe4/edit

I've tested this in FireFox, Chrome, Safari and Opera and all seem to be working fine. Could you please re-submit your ticket with further information or a test case?.

comment:2 Changed 9 years ago by alec

Resolution: worksforme
Status: closedreopened

This is related with page onload event.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3rc1.js"></script>
<script type="text/javascript">
function onload_handler()
{
    $('body').append('a');
    $(window).resize(function() { $('body').append('b'); });
    $(window).resize();
};
</script>
</head>
<body onload="onload_handler()">
</body>
</html>

I've observed, maybe not related, warning in Firefox (Unknown pseudoclass or pseudoelement "sizzle", orsth like that, I've got this localized), but no errors.

comment:3 Changed 9 years ago by alec

I've found also that this is working on IE 6-8. It doesn't work with all other browsers.

comment:4 Changed 9 years ago by addyosmani

Hey Alec,

Here's a replica of your second test case for reference: http://jsfiddle.net/addyosmani/cwgMY/

This is working fine for me on OSX across FireFox 3.6.10, Opera, Chrome and Safari (as per the original) with the output appending 'b' correctly on window resize.

Are you finding this issue on Windows? I can test on that too if needed.

comment:5 Changed 9 years ago by alec

Yes, it doesn't work on Opera, FF, Chrome, Safari on WindowsXP and Opera, FF, Chromium on Linux. I've found this is working only on IE6-8.

comment:6 Changed 9 years ago by addyosmani

It may be limited to XP at the moment. I'll leave this open in case anyone else can test and verify the issue on that version of Windows.

Windows Vista tests just to confirm: This is working fine on Chrome, Safari, FF and IE8.

comment:7 Changed 9 years ago by john

Resolution: fixed
Status: reopenedclosed
Version: 1.4.2
Note: See TracTickets for help on using tickets.