I am using 1.1 as I just downloaded it last night. And, I have tried cut and pasting the code directly from demo pages.
I have the following in the head of my page:
<script type="text/javascript" src="assets/js/mootools.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){
//-vertical
var mySlide = new Fx.Slide('test');
$('slidein').addEvent('click', function(e){
e = new Event(e);
mySlide.slideIn();
e.stop();
});
$('slideout').addEvent('click', function(e){
e = new Event(e);
mySlide.slideOut();
e.stop();
});
$('toggle').addEvent('click', function(e){
e = new Event(e);
mySlide.toggle();
e.stop();
});
$('hide').addEvent('click', function(e){
e = new Event(e);
mySlide.hide();
e.stop();
});
//--horizontal
var mySlide2 = new Fx.Slide('test2', {mode: 'horizontal'});
$('slidein2').addEvent('click', function(e){
e = new Event(e);
mySlide2.slideIn();
e.stop();
});
$('slideout2').addEvent('click', function(e){
e = new Event(e);
mySlide2.slideOut();
e.stop();
});
$('toggle2').addEvent('click', function(e){
e = new Event(e);
mySlide2.toggle();
e.stop();
});
$('hide2').addEvent('click', function(e){
e = new Event(e);
mySlide2.hide();
e.stop();
}); });
</script>
mootools.js is the file I downloaded from
http://mootools.net/download that included the ’Core’ and ’Fx.Slide’ (and its dependencies).
The following is the html I have for what I am trying to toggle:
<p>
<a href="#" id="toggle" name="toggle" title="toggle">Toggle</a>
</p>
<div id="test">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.
</div>
Yet I still get an error:
window.addEvent is not a function
[Break on this error] window.addEvent('domready', function(){
I am pretty stumped.