Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. var removeWhenOpen = true; var done = false;
  2. var timer0;
  3. jQuery(document).ready(function() {
  4. $('#doors').hover(function() {
  5. jQuery('#door-left').stop().animate({left:-500}, 1500, function() { if (removeWhenOpen) $(this).remove(); done=true; });
  6. jQuery('#door-right').stop().animate({right:-500}, 1500, function() { if (removeWhenOpen) $(this).remove(); });
  7. var timer0 = setTimeout(function() {
  8. jQuery('#ladyonthelake').stop().animate({opacity:0}, 2000);
  9. }, 5);
  10. }, function() {
  11. jQuery('#door-left').stop().animate({left:0}, 250);
  12. jQuery('#door-right').stop().animate({right:0}, 250);
  13. if (!done) {
  14. if (timer0) clearTimeout(timer0);
  15. jQuery('#ladyonthelake').stop().fadeIn();
  16. }
  17. })
  18. });
  19.  
  20.  
  21. <div id="doors">
  22. <img src="http://theitentrepreneurs.com/temp/ladyonthelake.jpg" width="347" height="520" border="0" id="ladyonthelake" />
  23. <div id="door-left" class="door"><div class="inner"></div><img src="http://theitentrepreneurs.com/temp/doorleft.png" /></div>
  24. <div id="door-right" class="door"><div class="inner"></div><img src="http://theitentrepreneurs.com/temp/doorright.png" /></div>
  25. </div>
  26.  
  27. 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