global.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. function autoFlashHeight(){
  2. $(".sideBar").height($(window).height());
  3. $(".contentItem").height($(window).height());
  4. $(".contentItem").width($(window).width()-150);
  5. $(".cover").width($(window).width());
  6. $(".cover").height($(window).height());
  7. };
  8. $(function(){
  9. // $(".mainTab li").click(function(){
  10. // $(this).addClass("now").siblings().removeClass("now");
  11. // $(".warpContent > .contentItem ").hide().eq($(".mainTab li").index(this)).animate({opacity: 'toggle'},500);});
  12. // $(function(){
  13. // tabs($(".mainTab li"), $('.contentItem'));
  14. // })
  15. // var tabs = function(mainTab , contentItem){
  16. // mainTab.click(function(){
  17. // var indx = mainTab.index(this);
  18. // mainTab.removeClass('now');
  19. // $(this).addClass('now');
  20. // contentItem.hide();
  21. // contentItem.eq(indx).show();
  22. // })
  23. // }
  24. var q=1;
  25. var show_li = $("#pointer1 li");
  26. show_li.each(function(index){
  27. $(this).click(function(){
  28. $(this).addClass("now").siblings().removeClass("now");
  29. $("#slideBanner1 .bannerEntry").fadeOut("fast").eq($(".pointer1 li").index(this)).fadeIn("fast");
  30. q=index+1;
  31. });
  32. });
  33. /*--------------------------------------------------------*/
  34. var auto_show = true;
  35. $("#pointer1,.learnMore").hover(function(){
  36. auto_show = false;
  37. },function(){
  38. auto_show = true;
  39. });
  40. /*自动轮换*/
  41. var max_num=2;//最大数减一
  42. setInterval(function(){
  43. if(auto_show){
  44. if(q>1){
  45. q=0;
  46. }
  47. $("#slideBanner1 .bannerEntry").fadeOut("fast").eq(q).fadeIn("fast");
  48. show_li.removeClass("now")
  49. show_li.eq(q).addClass("now");
  50. }
  51. q++;
  52. },5000);//end setInterval
  53. });