question.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. $(document).ready(function() {
  2. $('#menu li div').hover(function(){
  3. $(this).stop().animate({
  4. opacity: 1
  5. },100);
  6. },function(){
  7. $(this).stop().animate({
  8. opacity: 0.5
  9. }, 100);
  10. });
  11. //------------------------------------------鼠标点击图片
  12. var i=1;
  13. $('#menu').children('li').click(function(){
  14. if(i==1){
  15. wz=$(this).css('left');
  16. tz=$(this).css('top');
  17. dq=$(this).index();
  18. $(this).siblings(dq).fadeOut();
  19. $(this).stop().animate({left:'-10px',top:'50px'},300) ;
  20. $(this).children('li div').attr('id','red');
  21. $(this).children('img').animate({opacity:'1'});
  22. $(this).children('.aaays').css('display','none');
  23. //$('#dang').css('z-index','999');
  24. //------------------------------------------鼠标划出全部的时候
  25. $('#name').children('div').eq(dq).stop().animate({top:'-10px'},300);
  26. i++;
  27. }
  28. $('.close').click(function(){
  29. $('#menu li div').removeAttr("id");
  30. $('#nav').find('li').fadeIn();
  31. $('#nav').find('li').eq(dq).stop().animate({left:wz,top:tz},300);
  32. $('#name').children('div').eq(dq).stop().animate({top:'-1300px'});
  33. i=1;
  34. //$('#dang').css('z-index','0');
  35. });
  36. });
  37. /*$('#nav').hover(function(){ },function(){
  38. $('#nav').find('li').fadeIn();
  39. $('#nav').find('li').eq(dq).animate({left:wz},1000);
  40. $('#name').children('div').eq(dq).animate({top:'-500px'});
  41. $('#dang').css('z-index','0');
  42. })*/
  43. //------------------------------------------鼠标滑过透明
  44. /*$('#aaa').children('li').hover(function(){
  45. $(this).children('img').animate({opacity:'0.5'},500);
  46. $(this).children('.aaays').css('display','block');
  47. },function(){
  48. $(this).children('img').animate({opacity:'1'});
  49. $(this).children('.aaays').css('display','none');
  50. });*/
  51. });