Can you have more than one event in the house?

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

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

but can you do something similar with mootools?

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

Is it possible? Or will I just have to go about it differently?

+4
source share
1 answer

You may have multiple window.addEvent('domready', function(){}); but this, in my opinion, strikes the goal of Mootools writing elegant code.

Example w / 3 Home

+7
source

Source: https://habr.com/ru/post/1340027/


All Articles