Hi all
I’m new to javascript but come using Actionscript for a number of years and I’m really confused by some of the Js syntax.
I’m trying to work with mootools Fx.Slide
[CODE]
window.addEvent(‘domready’, function() {
var status = {
‘true’: ‘open’,
‘false’: ‘close’
};
var myVerticalSlide = new Fx.Slide(‘vertical_slide’);
$(‘slidein’).addEvent(‘click’, function(e){
e.stop();
myVerticalSlide.slideIn();
});
$(‘slideout’).addEvent(‘click’, function(e){
e.stop();
myVerticalSlide.slideOut();
});
myVerticalSlide.addEvent(‘complete’, function() {
$(‘vertical_status’).set(‘html’, status[myVerticalSlide.open]);
});
});
I’m confused with the use of parentheses ‘()’, In the window.addEvent function the end parentheses looks like it finishes outside the function.
[CODE]
window.addEvent(‘domready’, function() {
});
I would of expected it to look like
[CODE]
window.addEvent(‘domready’, function()) {
};
Also could someone explain the use of $ in
[CODE]
$(‘slidein’)
Can someone explain whats going on here or point me in the direction of a tutorial that might – I have looked but can’t find anything.
Any help would be greatly appreciated.