首页 新闻 会员 周边

哪里错了 找不到对象。

0
悬赏园豆:50 [已解决问题] 解决于 2012-10-17 10:06
 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() {  报错行 。
js
问题补充:

[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>
Lucky樱桃的主页 Lucky樱桃 | 初学一级 | 园豆:126
提问于:2012-10-16 16:41
< >
分享
最佳答案
0

姐。。。。。。。你调用jquery文件了吗?  $没有找到。。。。。。说明你的jquery文件没有被加载进去啊

收获园豆:50
暗香残留 | 菜鸟二级 |园豆:213 | 2012-10-16 17:07
<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>
Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:10

@长头发: 允许一下查看源文件里面有没有加载jquery文件

暗香残留 | 园豆:213 (菜鸟二级) | 2012-10-16 17:18

@暗香残留: 允许一下查看源文件里面有没有加载jquery文件  怎么允许啊 

Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:19

@长头发: 运行一下。。。。。。打错字了,不好意思

暗香残留 | 园豆:213 (菜鸟二级) | 2012-10-16 17:21

@暗香残留: 运行了也不行涅 。

Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:25

@长头发: 路径对不对。。。。。。。是直接拽过去的吗?

暗香残留 | 园豆:213 (菜鸟二级) | 2012-10-16 17:34

@暗香残留: 对啊 。路径对啊 。

Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:41

@长头发: 

<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文件里面。。。。。。没有发生$找不到的问题啊

暗香残留 | 园豆:213 (菜鸟二级) | 2012-10-16 17:41

@暗香残留: 尴尬 不管了 。看得我眼睛疼

Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:45

@长头发: ...........要先加载jquery文件。。。。。然后用$

暗香残留 | 园豆:213 (菜鸟二级) | 2012-10-16 17:47

@暗香残留: 我的文件里是你这样的。

Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:50
其他回答(10)
0

你运行起来的那个错应该不是有报具体的信息么,比如到多少行出错之类的

念念啊 | 园豆:415 (菜鸟二级) | 2012-10-16 16:45
0

此等代码不知道那个没有对象

nil | 园豆:879 (小虾三级) | 2012-10-16 16:45
0

哪里找不到对象,代码行定位一下先

田林九村 | 园豆:2367 (老鸟四级) | 2012-10-16 16:47
0

chrome 开发者工具应该很容易找到错误的地方

chenping2008 | 园豆:9836 (大侠五级) | 2012-10-16 16:52

但是右键找不到程序 。

支持(0) 反对(0) Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:30

chrome 的程序找不到 。

支持(0) 反对(0) Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:30

@长头发: 你应该是jquery JS文件没有引用对啊

chrome 按F12,或者打开开发者工具

支持(0) 反对(0) chenping2008 | 园豆:9836 (大侠五级) | 2012-10-16 21:32
0

不理我~~~哎

大蘋果 | 园豆:189 (初学一级) | 2012-10-16 16:55

贴完了

支持(0) 反对(0) Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:29
0

找不到对象,去注册非诚勿扰嘛

Ethan轻叹 | 园豆:996 (小虾三级) | 2012-10-16 16:57

和我同事说一句话 。唉 。。怀疑 。。

支持(0) 反对(0) Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:00

高人

支持(0) 反对(0) 田林九村 | 园豆:2367 (老鸟四级) | 2012-10-16 17:00

@田林九村: 又被调戏了

支持(0) 反对(0) Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:09
0

我比较系统ie的js调试  你光贴js 眼睛都看花了

JCdon | 园豆:2 (初学一级) | 2012-10-16 17:03
0

把多余的jqueyr.js文件删除掉,你加载那么多的jquery文件,貌似引发冲突了

az235 | 园豆:8483 (大侠五级) | 2012-10-16 17:36

后面已经注释了 。

支持(0) 反对(0) Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:40

@长头发: 没看到你注释啊

支持(0) 反对(0) az235 | 园豆:8483 (大侠五级) | 2012-10-16 17:41

@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>

就加载这两个啊 。多了 ?

支持(0) 反对(0) Lucky樱桃 | 园豆:126 (初学一级) | 2012-10-16 17:48

@长头发: 

这两jquery 文件是不是只是版本不同?
支持(0) 反对(0) az235 | 园豆:8483 (大侠五级) | 2012-10-16 17:54
0

额滴神啊

八戒的师傅 | 园豆:1472 (小虾三级) | 2012-10-16 20:46
0

这个也太犀利了,看着我头晕啊!

 

 

政和生活网

po~饭盒 | 园豆:231 (菜鸟二级) | 2012-10-16 21:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册