Mootools script will not work in Internet Explorer 7

I hope you can help

I'm relatively new to mootools (and brand new here), and I was working on a basic open closed div. This can be seen here: http://jsfiddle.net/jessicajet/2jZz5/ . It includes a script click link that I found elsewhere.

<script> window.addEvent('load', function() { Element.Events.outerClick = { base : 'click', condition : function(event){ event.stopPropagation(); return false; }, onAdd : function(fn){ this.getDocument().addEvent('click', fn); }, onRemove : function(fn){ this.getDocument().removeEvent('click', fn); } }; (function() { var opener = $('box2'); var boxtoopen = $('box'); var testmorph = $('test') boxtoopen.set('morph', { duration: 800, }); boxtoopen.addEvent('outerClick', function(event) { boxtoopen.morph(".openOff"); testmorph.morph(".openOff2"); }); opener.addEvent('click', function(e) { e.stop(); boxtoopen.morph(".openOn"); testmorph.morph(".openOn2"); }); })(); var clix = new dwClickables({ elements: $('.box2'), anchorToSpan: true }); }); </script> 

It doesn't seem to work in ie7, although it seems to be compatible with other browsers?

Can someone help me solve this problem and give me some tips for future use?

Yours faithfully,

Jessica

+4
source share
1 answer

Typos are often the worst search errors;) and IE can be very strict.

http://jsfiddle.net/2jZz5/2/

I added the missing semicolon (;) and removed the unnecessary comma (,)

Before:

 var opener = $('box2'); var boxtoopen = $('box'); var testmorph = $('test') boxtoopen.set('morph', { duration: 800, }); 

After:

 var opener = $('box2'); var boxtoopen = $('box'); var testmorph = $('test'); boxtoopen.set('morph', { duration: 800 }); 
+3
source

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


All Articles