Opened 14 years ago
Closed 14 years ago
#4333 closed bug (invalid)
Jquery Selector and window onload
Reported by: | onthefloor | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | unfiled | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi there:
So i updated to 1.3.2 version today, and i found a bug : So when i add function at parameter, this parameter is an function pointer, so when the page was loading i call this function : example:
function addLoadEvent(function_) {
var old= window.onload; document.getElementById("preLoadDiv").style.display = "block"; if (typeof window.onload != 'function') {
window.onload = function_;
} else {
window.onload = function() {
if (old) {
old();
} function_();
}
}
}
And when i was calling : addLoadEvent(function() {
$("#preLoadDiv").hide("slow"); });
It was work perfectly in 1.3.1 version, please fix it, thank you. My pages use that function.
Attachments (3)
Change History (7)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Can you put together a complete example with html and script? The snippet you have there isn't clearly showing a problem.
Changed 14 years ago by
Attachment: | jquery-1.3.2.js added |
---|
Changed 14 years ago by
Attachment: | jquery-1.3.1.js added |
---|
comment:3 Changed 14 years ago by
Hi, I attached an example html file. Try it first with the 1.3.2 version, then with the 1.3.1
Have you got an idea ?
comment:4 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
That is a really bad way to chain event handlers. Instead of addLoadEvent, just use $(document).load() or $(document).ready().
I forgot the essence. The #preLoadDiv layout was changing the display option to block, but when the page was loaded, the layout wasnt changing to hide.