Ticket #7514 (closed bug: notabug)
resizable() triggers a $(window).resize with jQuery 1.6.1
| Reported by: | slavik524 | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.9.0 |
| Component: | ui.resizable | Version: | 1.8.13 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When start resizing a resizable div, $(window).resize fires immediately and continues to trigger until I stop resizing a div. It only behaves this way with jQuery 1.6.1 (all is fine with 1.5.2). Sample code:
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="js/jquery-ui.js" type="text/javascript"></script>
<style type="text/css">
#div1 {
width: 200px;
height: 200px;
top: 100px;
left: 100px;
position: relative;
background: #888;
}
.ui-resizable-e {
width: 12px;
height: 100%;
top: 0;
right: 0;
position: absolute;
background: #333;
cursor: e-resize;
}
</style>
<script type="text/javascript">
$(function() {
$("#div1").resizable({ handles: "e" });
$(window).resize(function() { alert("Window resized"); });
});
</script>
</head>
<body>
<div id="div1"></div>
</body>
</html>
Change History
comment:1 Changed 22 months ago by scott.gonzalez
- Status changed from new to closed
- Resolution set to invalid
comment:2 Changed 21 months ago by brotherli
Can be workarounded with target checking:
$(window).resize(function(e) {
if (e.target == window)
/* do your stuff here */;
});
Note: See
TracTickets for help on using
tickets.


This is a bug in jQuery core: http://bugs.jquery.com/ticket/9841