jQuery forcing tables to go wide and plugin to vanish.

jQuery forcing tables to go wide and plugin to vanish.

I'm working on a client's site and I decided to use a slider ... http://assault.toceffect.com it can be seen there as I develop it.

Here's the problem:  If you refresh the page enough times, the table that contains the slider will go SUPER wide, it will go 2400px wide in fact.

2400px is the combined width of all my images.

When I followed the tutorial here on jQuery.com that value was originally set to 99999px ... you can imagine that before I changed that value, the table forced the page out to 99999px wide ... annoying.  

Why not just adjust the width to the size of one image?  Well I tried that.  Each image is 600x300 so I set the width to 600 the result was ... WHOOPSIBROKEIT.  The images stack all on top of eachother and slide together.

I've noticed that when it happens it also throws off the alignment of the top portion of the site, for instance my center tags -- I'll be looking to see if maybe something outside of the plugin is causing it.  

What do you guys think?  Any help?

  1. (function($){$.fn.jwSlider=function(b){var c={speed:1000,pause:5000,transition:'slide'},b=$.extend(c,b);if(b.pause<=b.speed)b.pause=b.speed+100;return this.each(function(){var a=$(this);a.wrap('<div class="slider-wrap" />');a.css({'width':'2400px','position':'relative','padding':0});if(b.transition==='slide'){a.children().css({'float':'left','list-style':'none'});$('.slider-wrap').css({'width':a.children().width(),'overflow':'hidden'})}if(b.transition==='fade'){a.children().css({'width':a.children().width(),'position':'absolute','left':0});for(var i=a.children().length,y=0;i>0;i--,y++){a.children().eq(y).css('zIndex',i+600)}fade()}if(b.transition==='slide')slide();function slide(){setInterval(function(){a.animate({'left':'-'+a.parent().width()},b.speed,function(){a.css('left',0).children(':first').appendTo(a)})},b.pause)}function fade(){setInterval(function(){a.children(':first').animate({'opacity':0},b.speed,function(){a.children(':first').css('opacity',1).css('zIndex',a.children(':last').css('zIndex')-1).appendTo(a)})},b.pause)}})}})(jQuery);