#6157 closed bug (worksforme)
$(window).resize() bug elements on Webkit
Reported by: | david71rj | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.4.2 |
Component: | event | Version: | 1.4.1 |
Keywords: | window, resize | Cc: | |
Blocked by: | Blocking: |
Description
HTML: <div id="main"></div>
CSS (I do with normal CSS): #main {
position: absolute; width: 760px; min-height: 540px;
}
JS: $(function(){ $(window).resize(function(){ console.log($("#main").width()); Bug: Will return $(window).width() instead!!! }); $(window).resize(); Here start the bug });
If you resize normally the page, this works fine, but automatically, don't.
Bye.
Change History (3)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Sorry, this occur if you load CSS after JS. Then CSS style is applied after. The stranger is that I'm using $READY method, or be, all is ready to apply changes.
It's can be considered bug?
Bye.
comment:3 Changed 12 years ago by
Priority: | → undecided |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Load the css before the js, that's important on webkit browsers.
HTML:
CSS (I do with normal CSS):
JS:
If you resize normally the page, this works fine, but automatically, don't.
Bye.