jquery滑块-mc未定义

发布于 2024-08-31 07:32:56 字数 545 浏览 5 评论 0原文

我目前已经实现了此图像滑块 http://www.dreamcss .com/2009/04/create-beautiful-jquery-sliders.html 在网站上,但由于某种原因我收到错误消息“mc 未定义”。

不幸的是,我无法显示该网站的链接,因为该网站尚未向公众开放。

当我查看 javascript 文件时,我可以看到 mc 变量没有在任何地方定义。但是当我将其删除时,我只是收到另一个错误,提示“css_ims 未定义”。如果我取消注释这一行,我现在会收到另一条错误消息,提示“css_cims 未定义”。到目前为止,画廊仍在工作,但是当我取消注释最后一个错误时,它就中断了。

我真的不知道我能做些什么来解决这个问题。

很抱歉,我无法发布该页面的直接链接,但可以在网站上找到 JavaScript 的源代码以及本文开头的教程。

任何想法或建议都非常受欢迎。

I have currently implemented this image slider http://www.dreamcss.com/2009/04/create-beautiful-jquery-sliders.html on a site but for some reason I get the error message "mc is not defined".

Unfortunately I can't show a link to the site since it's not accessible to the public yet.

When I look in the javascript file I can see that the mc variable is not defined anywhere. But when I strip it out I just get another error saying "css_ims is not defined". If I uncomment this line I get yet another error message now saying "css_cims is not defined". So far the gallery is still working but when I uncomment the last error it breaks.

I'm really lost on what I can do about this to fix it.

I'm sorry that I'm not able to post a direct link to the page but the source code for the JavaScript can be found on the site with the tutorial in the beginning of this post.

Any ideas or suggestions are much welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

命硬 2024-09-07 07:32:56

您应该删除该行:mc.init();
以及第 53 行的整个函数:

$(window).load(function(){

$.each(css_ims,function(){(new Image()).src=_siteRoot+'css/images/'+this;});

$.each(css_cims,function(){

   var css_im=this;

   $.each(['blue','purple','pink','red','grey','green','yellow','orange'],function(){

    (new Image()).src=_siteRoot+'css/'+this+'/'+css_im;

   });

  });

 });

You should remove the line with: mc.init();
and also the whole function from line 53:

$(window).load(function(){

$.each(css_ims,function(){(new Image()).src=_siteRoot+'css/images/'+this;});

$.each(css_cims,function(){

   var css_im=this;

   $.each(['blue','purple','pink','red','grey','green','yellow','orange'],function(){

    (new Image()).src=_siteRoot+'css/'+this+'/'+css_im;

   });

  });

 });
童话 2024-09-07 07:32:56

几天前,我在我的一个网站上集成了相同的滑块。错误/问题在于:

$(window).load(function(){
  $.each(css_ims,function(){(new Image()).src=_siteRoot+'css/images/'+this;});
  $.each(css_cims,function(){
   var css_im=this;
   $.each(['blue','purple','pink','red','grey','green','yellow','orange'],function(){
    (new Image()).src=_siteRoot+'css/'+this+'/'+css_im;
   });
  });
});

从第 52 行到第 60 行需要删除,我的猜测是这确实是为其他目的而计划的,或者是更改颜色的选项。

谢谢,
埃米尔

Few days ago I integrated the same slider on one of my sites. The error/issue is with:

$(window).load(function(){
  $.each(css_ims,function(){(new Image()).src=_siteRoot+'css/images/'+this;});
  $.each(css_cims,function(){
   var css_im=this;
   $.each(['blue','purple','pink','red','grey','green','yellow','orange'],function(){
    (new Image()).src=_siteRoot+'css/'+this+'/'+css_im;
   });
  });
});

From line 52 to line 60 needs to be removed my guess is that this indeed was planned for something else, or the option to change colors.

Thanks,
Emil

征棹 2024-09-07 07:32:56

前往返回演示网站并下拉从现场演示中查看 script.js,您会注意到根本没有引用 mc,也根本没有 mc.init() 调用。文章作者可能链接到该文件的不同版本。

Go back to the demo site and pull down the scripts.js from the live demo, you'll notice that one does not reference mc at all, there is no mc.init() call at all. The article writer probably linked to a different version of that file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文