Created
April 13, 2011 16:41
-
-
Save smtm/917886 to your computer and use it in GitHub Desktop.
What is the best way to do onload Script execution?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// onLoad Syntax with calling jQuery in "Person" | |
jQuery(function() { | |
var cheight=$("#content").height(); | |
var nheight=$("#navbar").height(); | |
if (cheight>nheight) { | |
$("#navbar").height(cheight); | |
} | |
}); | |
// same as above, more terse, we assume jQuery loaded | |
$(function() { | |
$('#topslider').do_stuff...; | |
}); | |
// use this with Prototype | |
document.observe("dom:loaded", function() { | |
Site.adjustNavbar(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment