开发者

Can you have more than one domready event?

开发者 https://www.devze.com 2023-02-11 08:39 出处:网络
I\'m a bit new to mootools, but I know in jQuery you can have more that one function (in more than one file):

I'm a bit new to mootools, but I know in jQuery you can have more that one function (in more than one file):

$(document).ready(function() {
    // put all your jQuery goodness in here.
});

but can you do s开发者_如何学JAVAomething similar with mootools?

I already have a window.addEvent( "domready", function() { already in my page and I really don't want to have to change that piece of code at all, but I want to be able to add another domready function in a seperate file in the header.

Is this possible? Or am I just going to have to go about it in another way?


You can have multiple window.addEvent('domready', function(){}); but it kind of defeats Mootools' purpose of writting elegant code, in my opinion.

Example w/ 3 Domready

0

精彩评论

暂无评论...
验证码 换一张
取 消