code_junkie

JQuery: animate() doesn't work as expected in IE

Nov 12th, 2011
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. function accordion_starting_page(){
  2. // hide all elements except the first one
  3. $('#FCE-Inhalt02-ContentWrapper .FCE-Fade:not(:first)').css("height", "0").hide();
  4. $('#FCE-Inhalt02-ContentWrapper .FCE-Fade:first').addClass("isVisible");
  5.  
  6. $('div.FCE-Title').click(function(){
  7.  
  8. // if user clicks on an already opened element => do nothing
  9. if (parseFloat($(this).next('.FCE-Fade').css("height")) > 0) {
  10. return false;
  11. }
  12.  
  13. var toHide = $(this).siblings('.FCE-Fade.isVisible');
  14.  
  15. toHide.removeClass("isVisible");
  16.  
  17. // close all opened siblings
  18. toHide.animate({"height": "0", "display": "none"}, 1000);
  19.  
  20. $(this).next('.FCE-Fade').addClass("isVisible").animate({"height" : "200"}, 1000);
  21.  
  22. return false;
  23. });
  24. }
  25.  
  26. $('li').hover(function(){
  27.  
  28. $this = $(this);
  29.  
  30. var bottom = '-45px'; //valor default para subir.
  31.  
  32. if( $this.css('height') == '320px' ){bottom = '-115px';}
  33.  
  34. $this.css('cursor', 'pointer').find('p').stop().find('.first').hide().end().animate({bottom: bottom}, {queue:false, duration:300});
  35.  
  36. }, function(){
  37.  
  38. var $this = $(this);
  39.  
  40. var bottom = '-178px'; //valor default para descer
  41.  
  42. if( $this.css('height') == '320px' ){bottom = '-432px';}
  43.  
  44. $this.find('p').stop().animate({***position: 'absolute'***, bottom:bottom}, {queue:false, duration:300}).find('.first').show();
  45.  
  46. });//fim do hover()
  47.  
  48. $('li').hover(function(){
  49.  
  50. $this = $(this);
  51.  
  52. var bottom = '-45px'; //valor default para subir.
  53.  
  54. if( $this.css('height') == '320px' ){bottom = '-115px';}
  55.  
  56. $this.css('cursor', 'pointer').find('p').stop().find('.first').hide().end().animate({bottom: bottom}, {queue:false, duration:300});
  57.  
  58. }, function(){
  59.  
  60. var $this = $(this);
  61.  
  62. var bottom = '-178px'; //valor default para descer
  63.  
  64. if( $this.css('height') == '320px' ){bottom = '-432px';}
  65.  
  66. $this.find('p').stop().animate({bottom:bottom}, {queue:false, duration:300}).find('.first').show();
  67.  
  68. });//fim do hover()
  69.  
  70. $('#bs1').animate({
  71. "left": bs1x
  72. }, 300, function() {
  73. // Animation complete.
  74. });
Add Comment
Please, Sign In to add comment