views:

563

answers:

3

Hi guys

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.

A: 

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.

curtisk
Hi curtiskThanks for your reply.I just got it fixed by removing the mc.init() statement and actually declaring the variables for the other two. I was just not thinking straight. Doh! :-)
Jan
A: 

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;

});

});

});

cephuo
A: 

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

Emil