Skip to main content

Bug Tracker

Side navigation

#7143 closed bug (fixed)

Opened October 11, 2010 08:37AM UTC

Closed October 11, 2010 10:21PM UTC

Last modified March 13, 2012 08:20PM UTC

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.

Attachments (0)
Change History (7)

Changed October 11, 2010 03:41PM UTC by addyosmani comment:1

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?.

Changed October 11, 2010 05:22PM UTC by alec comment:2

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.

Changed October 11, 2010 05:29PM UTC by alec comment:3

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

Changed October 11, 2010 05:52PM UTC by addyosmani comment:4

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.

Changed October 11, 2010 06:04PM UTC by alec comment:5

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.

Changed October 11, 2010 07:35PM UTC by addyosmani comment:6

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.

Changed October 11, 2010 10:21PM UTC by john comment:7

resolution: → fixed
status: reopenedclosed
version: → 1.4.2