Created
August 1, 2008 15:19
-
-
Save bryanjswift/3632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// not optimized for performance because the Fx.Tween object is continually recreated by calling $('big_picture').get('tween') with new options | |
$('left').addEvent('click', function(){ | |
if(!$('left').hasClass('deactivated')) { | |
current_id = $('big_picture').get('class').replace('image_', ''); | |
current_id--; | |
$('big_picture').get('tween',{ | |
onComplete: function() { | |
$('big_picture').set('src', 'pictures/' + current_id + '.jpg'); | |
$('big_picture').fade(1); | |
$('big_picture').set('class', 'image_' + current_id); | |
if(current_id==1) { $('left').set('class', 'deactivated'); } | |
if(current_id==(number_of_pictures-1)) { $('right').erase('class'); } | |
} | |
}); | |
$('big_picture').fade('hide'); | |
} | |
}); | |
// not optimized for performance because the Fx.Tween object is continually recreated by calling $('big_picture').get('tween') with new options | |
$('right').addEvent('click', function(){ | |
if(!$('right').hasClass('deactivated')) { | |
current_id = $('big_picture').get('class').replace('image_', ''); | |
current_id++; | |
$('big_picture').get('tween',{ | |
onComplete: function() { | |
$('big_picture').set('src', 'pictures/' + current_id + '.jpg'); | |
$('big_picture').fade(1); | |
$('big_picture').set('class', 'image_' + current_id); | |
if(current_id==2) { $('left').erase('class'); } | |
if(current_id==number_of_pictures) { $('right').set('class', 'deactivated'); } | |
} | |
}); | |
$('big_picture').fade('hide'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment