Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var removeWhenOpen = true; var done = false;
- var timer0;
- jQuery(document).ready(function() {
- $('#doors').hover(function() {
- jQuery('#door-left').stop().animate({left:-500}, 1500, function() { if (removeWhenOpen) $(this).remove(); done=true; });
- jQuery('#door-right').stop().animate({right:-500}, 1500, function() { if (removeWhenOpen) $(this).remove(); });
- var timer0 = setTimeout(function() {
- jQuery('#ladyonthelake').stop().animate({opacity:0}, 2000);
- }, 5);
- }, function() {
- jQuery('#door-left').stop().animate({left:0}, 250);
- jQuery('#door-right').stop().animate({right:0}, 250);
- if (!done) {
- if (timer0) clearTimeout(timer0);
- jQuery('#ladyonthelake').stop().fadeIn();
- }
- })
- });
- <div id="doors">
- <img src="http://theitentrepreneurs.com/temp/ladyonthelake.jpg" width="347" height="520" border="0" id="ladyonthelake" />
- <div id="door-left" class="door"><div class="inner"></div><img src="http://theitentrepreneurs.com/temp/doorleft.png" /></div>
- <div id="door-right" class="door"><div class="inner"></div><img src="http://theitentrepreneurs.com/temp/doorright.png" /></div>
- </div>
- jQuery('#door-left').stop().animate({left:-500}, 1500, function() { if (removeWhenOpen) $("#doors").remove(); done=true; });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement