1 <SCRIPT type=text/javascript> 2 var count; 3 $(function() { 4 $(".indexlutp").hover(function() { 5 $(".lunboxx").animate({height: "60px"}, 200 ); 6 $(".indexlubj").animate({height: "60px"}, 200 ); 7 },function(){ 8 $(".lunboxx").animate({height: "40px"}, 200 ); 9 $(".indexlubj").animate({height: "40px"}, 200 ); 10 }); 11 $(".lbonums a").hover(function() { 12 var key = $(this).text(); 13 $(this).addClass("lboclick").siblings().removeAttr("class"); 14 $("#downslide_"+key).fadeIn(1000).siblings().stop().hide().css("opacity",1); 15 }); 16 var _thumbImgIndex = 0; 17 $(".logoleft").click(function(){ 18 if( $(this).attr( "type" ) == 'down' ){ 19 cont = $(".brandmiddle"); 20 distance = '950'; 21 _maxCount = (cont.find("li").length) / 5; 22 }else{ 23 cont = $(".logocontent"); 24 distance = '948'; 25 _maxCount = (cont.find("li").length) / 5; 26 } 27 if ( _thumbImgIndex < 0 ) 28 return; 29 _thumbImgIndex -=5; 30 cont.animate({ 31 scrollLeft : "-="+distance 32 },2000); 33 }); 34 $(".logoright").click(function(){ 35 if( $(this).attr( "type" ) == 'down' ){ 36 cont = $(".brandmiddle"); 37 distance = '400'; 38 _maxCount = (cont.find("li").length) / 2; 39 }else{ 40 cont = $(".logocontent"); 41 distance = '398'; 42 _maxCount = (cont.find("li").length) / 2; 43 } 44 if ( _thumbImgIndex >= _maxCount ) 45 return; 46 _thumbImgIndex +=5; 47 cont.animate({ 48 scrollLeft : "+="+distance 49 },1000); 50 }); 51 //轮播JS 52 $("#main a").hover(function() { 53 $("#main").find("img").each(function() { 54 var width = $(this).attr( "width" ); 55 var height = $(this).attr( "height" ); 56 var id = $(this).attr( "id" ); 57 $("#"+id+"_s").css( "width",width ).css( "height",height ); 58 }); 59 $("#main .mask").not( $(".mask", this) ).stop().fadeTo("slow",0.3); 60 }, 61 function() { 62 $("#main .mask").not($(".mask", this) ).stop().fadeTo("slow",0); 63 }); 64 var slidetimer = setInterval("showAuto()", 4000); 65 $(".slike_key a").hover(function() { 66 var key = $(this).text(); 67 clearInterval(slidetimer); 68 $(this).addClass("selected").siblings().removeAttr("class"); 69 $("#slide_"+key).fadeIn(1000).siblings().stop().hide().css("opacity",1); 70 },function(){ 71 slidetimer = setInterval("showAuto()", 4000); 72 }); 73 $("#main").hover(function(){ 74 clearInterval(slidetimer) 75 }, 76 function(){ 77 slidetimer = setInterval("showAuto()", 4000); 78 }); 79 }); 80 function showAuto() 81 { 82 count = $(".slike_key a").length; 83 key = $(".slike_key .selected").text(); 84 if ( key == count ){ 85 key = 0; 86 } 87 $(".slike_key a:eq("+key+")").hover(); 88 } 89 </SCRIPT>
$(function() { 报错行 。
[16:59:40.584] ReferenceError: $ is not defined
1 <SCRIPT src="themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" 2 type=text/javascript></SCRIPT> 3 <SCRIPT src="themes/zzecshopcom_aimer/js/jquery.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery.js" 4 type=text/javascript></SCRIPT> 5 6 <SCRIPT src="themes/zzecshopcom_aimer/js/kandytabs.pack.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/kandytabs.pack.js" 7 type=text/javascript></SCRIPT> 8 9 <script type="text/javascript" src="themes/zzecshopcom_aimer/js/common1.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/common1.js"></script> 10 <SCRIPT type=text/javascript>
姐。。。。。。。你调用jquery文件了吗? $没有找到。。。。。。说明你的jquery文件没有被加载进去啊
<SCRIPT src="themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" type=text/javascript></SCRIPT> <script type="text/javascript" src="themes/zzecshopcom_aimer/js/common.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/common.js"></script><script type="text/javascript" src="themes/zzecshopcom_aimer/js/index.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/index.js"></script><SCRIPT src="themes/zzecshopcom_aimer/js/jquery.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery.js" type=text/javascript></SCRIPT> <SCRIPT src="themes/zzecshopcom_aimer/js/kandytabs.pack.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/kandytabs.pack.js" type=text/javascript></SCRIPT> <!--<SCRIPT src="themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" type=text/javascript></SCRIPT>--> <script type="text/javascript" src="themes/zzecshopcom_aimer/js/common1.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/common1.js"></script> <SCRIPT type=text/javascript>
@长头发: 允许一下查看源文件里面有没有加载jquery文件
@暗香残留: 允许一下查看源文件里面有没有加载jquery文件 怎么允许啊
@长头发: 运行一下。。。。。。打错字了,不好意思
@暗香残留: 运行了也不行涅 。
@长头发: 路径对不对。。。。。。。是直接拽过去的吗?
@暗香残留: 对啊 。路径对啊 。
@长头发:
<SCRIPT src="themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" type=text/javascript></SCRIPT> <SCRIPT src="themes/zzecshopcom_aimer/js/jquery.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery.js" type=text/javascript></SCRIPT> <script type="text/javascript" src="themes/zzecshopcom_aimer/js/common.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/common.js"></script><script type="text/javascript" src="themes/zzecshopcom_aimer/js/index.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/index.js"></script><!--<SCRIPT src="themes/zzecshopcom_aimer/js/jquery.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery.js" type=text/javascript></SCRIPT>--> <SCRIPT src="themes/zzecshopcom_aimer/js/kandytabs.pack.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/kandytabs.pack.js" type=text/javascript></SCRIPT> <!--<SCRIPT src="themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" type=text/javascript></SCRIPT>--> <script type="text/javascript" src="themes/zzecshopcom_aimer/js/common1.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/common1.js"></script> <SCRIPT type=text/javascript> <SCRIPT type=text/javascript> var count; $(function() { $(".indexlutp").hover(function() { $(".lunboxx").animate({height: "60px"}, 200 ); $(".indexlubj").animate({height: "60px"}, 200 ); },function(){ $(".lunboxx").animate({height: "40px"}, 200 ); $(".indexlubj").animate({height: "40px"}, 200 ); }); $(".lbonums a").hover(function() { var key = $(this).text(); $(this).addClass("lboclick").siblings().removeAttr("class"); $("#downslide_"+key).fadeIn(1000).siblings().stop().hide().css("opacity",1); }); var _thumbImgIndex = 0; $(".logoleft").click(function(){ if( $(this).attr( "type" ) == 'down' ){ cont = $(".brandmiddle"); distance = '950'; _maxCount = (cont.find("li").length) / 5; }else{ cont = $(".logocontent"); distance = '948'; _maxCount = (cont.find("li").length) / 5; } if ( _thumbImgIndex < 0 ) return; _thumbImgIndex -=5; cont.animate({ scrollLeft : "-="+distance },2000); }); $(".logoright").click(function(){ if( $(this).attr( "type" ) == 'down' ){ cont = $(".brandmiddle"); distance = '400'; _maxCount = (cont.find("li").length) / 2; }else{ cont = $(".logocontent"); distance = '398'; _maxCount = (cont.find("li").length) / 2; } if ( _thumbImgIndex >= _maxCount ) return; _thumbImgIndex +=5; cont.animate({ scrollLeft : "+="+distance },1000); }); //轮播JS $("#main a").hover(function() { $("#main").find("img").each(function() { var width = $(this).attr( "width" ); var height = $(this).attr( "height" ); var id = $(this).attr( "id" ); $("#"+id+"_s").css( "width",width ).css( "height",height ); }); $("#main .mask").not( $(".mask", this) ).stop().fadeTo("slow",0.3); }, function() { $("#main .mask").not($(".mask", this) ).stop().fadeTo("slow",0); }); var slidetimer = setInterval("showAuto()", 4000); $(".slike_key a").hover(function() { var key = $(this).text(); clearInterval(slidetimer); $(this).addClass("selected").siblings().removeAttr("class"); $("#slide_"+key).fadeIn(1000).siblings().stop().hide().css("opacity",1); },function(){ slidetimer = setInterval("showAuto()", 4000); }); $("#main").hover(function(){ clearInterval(slidetimer) }, function(){ slidetimer = setInterval("showAuto()", 4000); }); }); function showAuto() { count = $(".slike_key a").length; key = $(".slike_key .selected").text(); if ( key == count ){ key = 0; } $(".slike_key a:eq("+key+")").hover(); } </SCRIPT>
这是我复制的你的代码,放到一个html文件里面。。。。。。没有发生$找不到的问题啊
@暗香残留: 尴尬 不管了 。看得我眼睛疼
@长头发: ...........要先加载jquery文件。。。。。然后用$
@暗香残留: 我的文件里是你这样的。
你运行起来的那个错应该不是有报具体的信息么,比如到多少行出错之类的
此等代码不知道那个没有对象
哪里找不到对象,代码行定位一下先
chrome 开发者工具应该很容易找到错误的地方
但是右键找不到程序 。
chrome 的程序找不到 。
@长头发: 你应该是jquery JS文件没有引用对啊
chrome 按F12,或者打开开发者工具
不理我~~~哎
贴完了
找不到对象,去注册非诚勿扰嘛
和我同事说一句话 。唉 。。怀疑 。。
高人
@田林九村: 又被调戏了
我比较系统ie的js调试 你光贴js 眼睛都看花了
把多余的jqueyr.js文件删除掉,你加载那么多的jquery文件,貌似引发冲突了
后面已经注释了 。
@长头发: 没看到你注释啊
@az235:
1 <SCRIPT src="themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery-1.4.2.min.js" 2 type=text/javascript></SCRIPT> 3 <SCRIPT src="themes/zzecshopcom_aimer/js/jquery.js" tppabs="http://mobanzhongxin.zzecshop.com/aimer2012/themes/zzecshopcom_aimer/js/jquery.js" 4 type=text/javascript></SCRIPT>
就加载这两个啊 。多了 ?
@长头发:
这两jquery 文件是不是只是版本不同?
额滴神啊