SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Zealot west end lane's Avatar
    Join Date
    Mar 2010
    Location
    London, U.K.
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Script Error only in IE7

    Hi,

    Am running the Nivo Slider on my site here.

    Runs great in FF, Safari, Chrome, IE8, but throws up a script error on IE7 (and 6 but not too concerned about that).

    It states: internet explorer script error
    Line 23
    Char:
    error:expected identifier,string or number
    code:0

    As a result, the slideshow won't run at all in IE7, even though it should be compliant.

    Here is the js code that came with the slider (sorry it's sideways scrolling on here, must make it a pain to read). If I have grabbed the wrong piece of code, please let me know and I'll try again!:

    Code JavaScript:
    /*
     * jQuery Nivo Slider v1.6
     * [url]http://nivo.dev7studios.com[/url]
     *
     * Copyright 2010, Gilbert Pellegrom
     * Free to use and abuse under the MIT license.
     * [url]http://www.opensource.org/licenses/mit-license.php[/url]
     * 
     * March 2010
     */
     
    eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(7($){$.1H.1y=7(1U){8 d=0;8 j=\'\';8 1b=0;8 n=\'\';8 Q=w;8 1c=w;4=1L.1X({h:\'1p\',e:15,k:20,1e:27,S:R,1E:R,D:R,1x:R,1N:7(){},1P:7(){}},1U);U f.A(7(){8 3=$(f);3.c(\'2f\',\'22\');3.r(\'1A\');3.o(\'1A\');3.16(\'1y\');8 b=3.1Z();b.A(7(){8 u=$(f);5(!u.G(\'K\')){5(u.G(\'a\')){u.16(\'6-1Y\')}u=u.1j(\'K:1l\')}8 12=u.r();5(12==0)12=u.q(\'r\');8 W=u.o();5(W==0)W=u.q(\'o\');5(12>3.r()){3.r(12)}5(W>3.o()){3.o(W)}u.c(\'L\',\'1i\');1b++});5($(b[d]).G(\'K\')){j=$(b[d])}l{j=$(b[d]).1j(\'K:1l\')}5($(b[d]).G(\'a\')){$(b[d]).c(\'L\',\'1r\')}3.c(\'J\',\'M(\'+j.q(\'N\')+\') O-P\');1C(8 i=0;i<4.e;i++){8 z=19.1Q(3.r()/4.e);5(i==4.e-1){3.T($(\'<x C="6-9"></x>\').c({1J:(z*i)+\'X\',r:(3.r()-(z*i))+\'X\'}))}l{3.T($(\'<x C="6-9"></x>\').c({1J:(z*i)+\'X\',r:z+\'X\'}))}}3.T($(\'<x C="6-E"><p></p></x>\').c(\'L\',\'1i\'));5(j.q(\'Y\')!=\'\'){$(\'.6-E p\',3).1t(j.q(\'Y\'));$(\'.6-E\',3).1v(4.k)}8 s=1k(7(){F(3,b,4,w)},4.1e);5(4.S){3.T(\'<x C="6-S"><a C="6-1G">24</a><a C="6-1I">1W</a></x>\');5(4.1E){$(\'.6-S\',3).1F();3.1K(7(){$(\'.6-S\',3).23()},7(){$(\'.6-S\',3).1F()})}$(\'a.6-1G\',3).1g(\'1h\',7(){5(Q)U w;1a(s);s=\'\';d-=2;F(3,b,4,\'1O\')});$(\'a.6-1I\',3).1g(\'1h\',7(){5(Q)U w;1a(s);s=\'\';F(3,b,4,\'1M\')})}5(4.D){8 1f=$(\'<x C="6-D"></x>\');3.T(1f);1C(8 i=0;i<b.1T;i++){1f.T(\'<a C="6-1B" 1z="\'+i+\'">\'+(i+1)+\'</a>\')}$(\'.6-D a:1R(\'+d+\')\',3).16(\'14\');$(\'.6-D a\',3).1g(\'1h\',7(){5(Q)U w;5($(f).2b(\'14\'))U w;1a(s);s=\'\';3.c(\'J\',\'M(\'+j.q(\'N\')+\') O-P\');d=$(f).q(\'1z\')-1;F(3,b,4,\'1B\')})}5(4.1x){3.1K(7(){1c=R;1a(s);s=\'\'},7(){1c=w;5(s==\'\'){s=1k(7(){F(3,b,4,w)},4.1e)}})}3.29(\'6:I\',7(){Q=w;$(b).A(7(){5($(f).G(\'a\')){$(f).c(\'L\',\'1i\')}});5($(b[d]).G(\'a\')){$(b[d]).c(\'L\',\'1r\')}5(s==\'\'&&!1c){s=1k(7(){F(3,b,4,w)},4.1e)}4.1P.1V(f)})});7 F(3,b,4,1d){4.1N.1V(f);5(!1d){3.c(\'J\',\'M(\'+j.q(\'N\')+\') O-P\')}l{5(1d==\'1O\'){3.c(\'J\',\'M(\'+j.q(\'N\')+\') O-P\')}5(1d==\'1M\'){3.c(\'J\',\'M(\'+j.q(\'N\')+\') O-P\')}}d++;5(d==1b)d=0;5(d<0)d=(1b-1);5($(b[d]).G(\'K\')){j=$(b[d])}l{j=$(b[d]).1j(\'K:1l\')}5(4.D){$(\'.6-D a\',3).21(\'14\');$(\'.6-D a:1R(\'+d+\')\',3).16(\'14\')}5(j.q(\'Y\')!=\'\'){5($(\'.6-E\',3).c(\'L\')==\'1r\'){$(\'.6-E p\',3).1S(4.k,7(){$(f).1t(j.q(\'Y\'));$(f).1v(4.k)})}l{$(\'.6-E p\',3).1t(j.q(\'Y\'))}$(\'.6-E\',3).1v(4.k)}l{$(\'.6-E\',3).1S(4.k)}8 i=0;$(\'.6-9\',3).A(7(){8 z=19.1Q(3.r()/4.e);$(f).c({o:\'H\',t:\'0\',J:\'M(\'+j.q(\'N\')+\') O-P -\'+((z+(i*z))-z)+\'X 0%\'});i++});5(4.h==\'1p\'){8 1q=2a 25("1o","10","1m","Z","1n","V","1w","17");n=1q[19.26(19.1p()*(1q.1T+1))];5(n==2c)n=\'17\'}Q=R;5(4.h==\'28\'||4.h==\'1o\'||n==\'1o\'||4.h==\'10\'||n==\'10\'){8 m=0;8 i=0;8 e=$(\'.6-9\',3);5(4.h==\'10\'||n==\'10\')e=$(\'.6-9\',3).13();e.A(7(){8 9=$(f);9.c(\'1u\',\'H\');5(i==4.e-1){B(7(){9.y({o:\'g%\',t:\'1.0\'},4.k,\'\',7(){3.11(\'6:I\')})},(g+m))}l{B(7(){9.y({o:\'g%\',t:\'1.0\'},4.k)},(g+m))}m+=18;i++})}l 5(4.h==\'2d\'||4.h==\'1m\'||n==\'1m\'||4.h==\'Z\'||n==\'Z\'){8 m=0;8 i=0;8 e=$(\'.6-9\',3);5(4.h==\'Z\'||n==\'Z\')e=$(\'.6-9\',3).13();e.A(7(){8 9=$(f);9.c(\'1D\',\'H\');5(i==4.e-1){B(7(){9.y({o:\'g%\',t:\'1.0\'},4.k,\'\',7(){3.11(\'6:I\')})},(g+m))}l{B(7(){9.y({o:\'g%\',t:\'1.0\'},4.k)},(g+m))}m+=18;i++})}l 5(4.h==\'1n\'||4.h==\'2e\'||n==\'1n\'||4.h==\'V\'||n==\'V\'){8 m=0;8 i=0;8 v=0;8 e=$(\'.6-9\',3);5(4.h==\'V\'||n==\'V\')e=$(\'.6-9\',3).13();e.A(7(){8 9=$(f);5(i==0){9.c(\'1u\',\'H\');i++}l{9.c(\'1D\',\'H\');i=0}5(v==4.e-1){B(7(){9.y({o:\'g%\',t:\'1.0\'},4.k,\'\',7(){3.11(\'6:I\')})},(g+m))}l{B(7(){9.y({o:\'g%\',t:\'1.0\'},4.k)},(g+m))}m+=18;v++})}l 5(4.h==\'1w\'||n==\'1w\'){8 m=0;8 i=0;$(\'.6-9\',3).A(7(){8 9=$(f);8 1s=9.r();9.c({1u:\'H\',o:\'g%\',r:\'H\'});5(i==4.e-1){B(7(){9.y({r:1s,t:\'1.0\'},4.k,\'\',7(){3.11(\'6:I\')})},(g+m))}l{B(7(){9.y({r:1s,t:\'1.0\'},4.k)},(g+m))}m+=18;i++})}l 5(4.h==\'17\'||n==\'17\'){8 i=0;$(\'.6-9\',3).A(7(){$(f).c(\'o\',\'g%\');5(i==4.e-1){$(f).y({t:\'1.0\'},(4.k*2),\'\',7(){3.11(\'6:I\')})}l{$(f).y({t:\'1.0\'},(4.k*2))}i++})}}};$.1H.13=[].13})(1L);',62,140,'|||slider|settings|if|nivo|function|var|slice||kids|css|currentSlide|slices|this|100|effect||currentImage|animSpeed|else|timeBuff|randAnim|height||attr|width|timer|opacity|child||false|div|animate|sliceWidth|each|setTimeout|class|controlNav|caption|nivoRun|is|0px|animFinished|background|img|display|url|src|no|repeat|running|true|directionNav|append|return|sliceUpDownLeft|childHeight|px|title|sliceUpLeft|sliceDownLeft|trigger|childWidth|reverse|active||addClass|fade|50|Math|clearInterval|totalSlides|paused|nudge|pauseTime|nivoControl|live|click|none|find|setInterval|first|sliceUpRight|sliceUpDown|sliceDownRight|random|anims|block|origWidth|html|top|fadeIn|fold|pauseOnHover|nivoSlider|rel|1px|control|for|bottom|directionNavHide|hide|prevNav|fn|nextNav|left|hover|jQuery|next|beforeChange|prev|afterChange|round|eq|fadeOut|length|options|call|Next|extend|imageLink|children|500|removeClass|relative|show|Prev|Array|floor|3000|sliceDown|bind|new|hasClass|undefined|sliceUp|sliceUpDownRight|position'.split('|'),0,{}))

  2. #2
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    I think your best bet at getting this fixed is to contact the creator(s) of Nivo slider. That code is packed, and therefore not very readable. It's probably just an extraneous comma somewhere, but the packed code is so unreadable that I couldn't find it...

    Alternatively you could download the 'development' version, as that's not packed.

  3. #3
    SitePoint Zealot west end lane's Avatar
    Join Date
    Mar 2010
    Location
    London, U.K.
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Immerse. I will get in touch with the developer then first as I guess he would be interested to know.

    If no joy I will try and post up the unpacked version.

    Cheers

  4. #4
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    If the unpacked version still has the same error, it'll be easier to track it down.

    If it doesn't have the error, then there's something going wrong with the packing. In that case you could just as well use the unpacked version. It's only 10Kb difference, and with some proper expiry date headers it'll only have to be downloaded once.

  5. #5
    SitePoint Zealot west end lane's Avatar
    Join Date
    Mar 2010
    Location
    London, U.K.
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well not had any reply over on the support forum for the slider yet, so I took out the packe version and added the development one. Just did a test and still getting the error on line 23 in IE7. Again, running fine in everything else.

    Here is the unpacked code:

    Code JavaScript:
    /*
     * jQuery Nivo Slider v2.0
     * [url]http://nivo.dev7studios.com[/url]
     *
     * Copyright 2010, Gilbert Pellegrom
     * Free to use and abuse under the MIT license.
     * [url]http://www.opensource.org/licenses/mit-license.php[/url]
     * 
     * May 2010 - Pick random effect from specified set of effects by toronegro
     * May 2010 - controlNavThumbsFromRel option added by nerd-sh
     * May 2010 - Do not start nivoRun timer if there is only 1 slide by msielski
     * April 2010 - controlNavThumbs option added by Jamie Thompson ([url]http://jamiethompson.co.uk[/url])
     * March 2010 - manualAdvance option added by HelloPablo ([url]http://hellopablo.co.uk[/url])
     */
     
    (function($) {
     
    	$.fn.nivoSlider = function(options) {
     
    		//Defaults are below
    		var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
     
    		return this.each(function() {
    			//Useful variables. Play carefully.
    			var vars = {
    				currentSlide: 0,
    				currentImage: '',
    				totalSlides: 0,
    				randAnim: '',
    				running: false,
    				paused: false,
    				stop:false
    			};
     
    			//Get this slider
    			var slider = $(this);
    			slider.data('nivo:vars', vars);
    			slider.css('position','relative');
    			slider.addClass('nivoSlider');
     
    			//Find our slider children
    			var kids = slider.children();
    			kids.each(function() {
    				var child = $(this);
    				var link = '';
    				if(!child.is('img')){
    					if(child.is('a')){
    						child.addClass('nivo-imageLink');
    						link = child;
    					}
    					child = child.find('img:first');
    				}
    				//Get img width & height
                    var childWidth = child.width();
                    if(childWidth == 0) childWidth = child.attr('width');
                    var childHeight = child.height();
                    if(childHeight == 0) childHeight = child.attr('height');
                    //Resize the slider
                    if(childWidth > slider.width()){
                        slider.width(childWidth);
                    }
                    if(childHeight > slider.height()){
                        slider.height(childHeight);
                    }
                    if(link != ''){
                        link.css('display','none');
                    }
                    child.css('display','none');
                    vars.totalSlides++;
    			});
     
    			//Set startSlide
    			if(settings.startSlide > 0){
    				if(settings.startSlide >= vars.totalSlides) settings.startSlide = vars.totalSlides - 1;
    				vars.currentSlide = settings.startSlide;
    			}
     
    			//Get initial image
    			if($(kids[vars.currentSlide]).is('img')){
    				vars.currentImage = $(kids[vars.currentSlide]);
    			} else {
    				vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
    			}
     
    			//Show initial link
    			if($(kids[vars.currentSlide]).is('a')){
    				$(kids[vars.currentSlide]).css('display','block');
    			}
     
    			//Set first background
    			slider.css('background','url('+ vars.currentImage.attr('src') +') no-repeat');
     
    			//Add initial slices
    			for(var i = 0; i < settings.slices; i++){
    				var sliceWidth = Math.round(slider.width()/settings.slices);
    				if(i == settings.slices-1){
    					slider.append(
    						$('<div class="nivo-slice"></div>').css({ left:(sliceWidth*i)+'px', width:(slider.width()-(sliceWidth*i))+'px' })
    					);
    				} else {
    					slider.append(
    						$('<div class="nivo-slice"></div>').css({ left:(sliceWidth*i)+'px', width:sliceWidth+'px' })
    					);
    				}
    			}
     
    			//Create caption
    			slider.append(
    				$('<div class="nivo-caption"><p></p></div>').css({ display:'none', opacity:settings.captionOpacity })
    			);			
    			//Process initial  caption
    			if(vars.currentImage.attr('title') != ''){
    				$('.nivo-caption p', slider).html(vars.currentImage.attr('title'));					
    				$('.nivo-caption', slider).fadeIn(settings.animSpeed);
    			}
     
    			//In the words of Super Mario "let's a go!"
    			var timer = 0;
    			if(!settings.manualAdvance && kids.length > 1){
    				timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
    			}
     
    			//Add Direction nav
    			if(settings.directionNav){
    				slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');
     
    				//Hide Direction nav
    				if(settings.directionNavHide){
    					$('.nivo-directionNav', slider).hide();
    					slider.hover(function(){
    						$('.nivo-directionNav', slider).show();
    					}, function(){
    						$('.nivo-directionNav', slider).hide();
    					});
    				}
     
    				$('a.nivo-prevNav', slider).live('click', function(){
    					if(vars.running) return false;
    					clearInterval(timer);
    					timer = '';
    					vars.currentSlide-=2;
    					nivoRun(slider, kids, settings, 'prev');
    				});
     
    				$('a.nivo-nextNav', slider).live('click', function(){
    					if(vars.running) return false;
    					clearInterval(timer);
    					timer = '';
    					nivoRun(slider, kids, settings, 'next');
    				});
    			}
     
    			//Add Control nav
    			if(settings.controlNav){
    				var nivoControl = $('<div class="nivo-controlNav"></div>');
    				slider.append(nivoControl);
    				for(var i = 0; i < kids.length; i++){
    					if(settings.controlNavThumbs){
    						var child = kids.eq(i);
    						if(!child.is('img')){
    							child = child.find('img:first');
    						}
                            if (settings.controlNavThumbsFromRel) {
                                nivoControl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('rel') + '" alt="" /></a>');
                            } else {
                                nivoControl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('src').replace(settings.controlNavThumbsSearch, settings.controlNavThumbsReplace) +'" alt="" /></a>');
                            }
    					} else {
    						nivoControl.append('<a class="nivo-control" rel="'+ i +'">'+ i +'</a>');
    					}
     
    				}
    				//Set initial active link
    				$('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active');
     
    				$('.nivo-controlNav a', slider).live('click', function(){
    					if(vars.running) return false;
    					if($(this).hasClass('active')) return false;
    					clearInterval(timer);
    					timer = '';
    					slider.css('background','url('+ vars.currentImage.attr('src') +') no-repeat');
    					vars.currentSlide = $(this).attr('rel') - 1;
    					nivoRun(slider, kids, settings, 'control');
    				});
    			}
     
    			//Keyboard Navigation
    			if(settings.keyboardNav){
    				$(window).keypress(function(event){
    					//Left
    					if(event.keyCode == '37'){
    						if(vars.running) return false;
    						clearInterval(timer);
    						timer = '';
    						vars.currentSlide-=2;
    						nivoRun(slider, kids, settings, 'prev');
    					}
    					//Right
    					if(event.keyCode == '39'){
    						if(vars.running) return false;
    						clearInterval(timer);
    						timer = '';
    						nivoRun(slider, kids, settings, 'next');
    					}
    				});
    			}
     
    			//For pauseOnHover setting
    			if(settings.pauseOnHover){
    				slider.hover(function(){
    					vars.paused = true;
    					clearInterval(timer);
    					timer = '';
    				}, function(){
    					vars.paused = false;
    					//Restart the timer
    					if(timer == '' && !settings.manualAdvance){
    						timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
    					}
    				});
    			}
     
    			//Event when Animation finishes
    			slider.bind('nivo:animFinished', function(){ 
    				vars.running = false; 
    				//Hide child links
    				$(kids).each(function(){
    					if($(this).is('a')){
    						$(this).css('display','none');
    					}
    				});
    				//Show current link
    				if($(kids[vars.currentSlide]).is('a')){
    					$(kids[vars.currentSlide]).css('display','block');
    				}
    				//Restart the timer
    				if(timer == '' && !vars.paused && !settings.manualAdvance){
    					timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
    				}
    				//Trigger the afterChange callback
    				settings.afterChange.call(this);
    			});
    		});
     
    		function nivoRun(slider, kids, settings, nudge){
    			//Get our vars
    			var vars = slider.data('nivo:vars');
    			if((!vars || vars.stop) && !nudge) return false;
     
    			//Trigger the beforeChange callback
    			settings.beforeChange.call(this);
     
    			//Set current background before change
    			if(!nudge){
    				slider.css('background','url('+ vars.currentImage.attr('src') +') no-repeat');
    			} else {
    				if(nudge == 'prev'){
    					slider.css('background','url('+ vars.currentImage.attr('src') +') no-repeat');
    				}
    				if(nudge == 'next'){
    					slider.css('background','url('+ vars.currentImage.attr('src') +') no-repeat');
    				}
    			}
    			vars.currentSlide++;
    			if(vars.currentSlide == vars.totalSlides){ 
    				vars.currentSlide = 0;
    				//Trigger the slideshowEnd callback
    				settings.slideshowEnd.call(this);
    			}
    			if(vars.currentSlide < 0) vars.currentSlide = (vars.totalSlides - 1);
    			//Set vars.currentImage
    			if($(kids[vars.currentSlide]).is('img')){
    				vars.currentImage = $(kids[vars.currentSlide]);
    			} else {
    				vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
    			}
     
    			//Set acitve links
    			if(settings.controlNav){
    				$('.nivo-controlNav a', slider).removeClass('active');
    				$('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active');
    			}
     
    			//Process caption
    			if(vars.currentImage.attr('title') != ''){
    				if($('.nivo-caption', slider).css('display') == 'block'){
    					$('.nivo-caption p', slider).fadeOut(settings.animSpeed, function(){
    						$(this).html(vars.currentImage.attr('title'));
    						$(this).fadeIn(settings.animSpeed);
    					});
    				} else {
    					$('.nivo-caption p', slider).html(vars.currentImage.attr('title'));
    				}					
    				$('.nivo-caption', slider).fadeIn(settings.animSpeed);
    			} else {
    				$('.nivo-caption', slider).fadeOut(settings.animSpeed);
    			}
     
    			//Set new slice backgrounds
    			var  i = 0;
    			$('.nivo-slice', slider).each(function(){
    				var sliceWidth = Math.round(slider.width()/settings.slices);
    				$(this).css({ height:'0px', opacity:'0', 
    					background: 'url('+ vars.currentImage.attr('src') +') no-repeat -'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px 0%' });
    				i++;
    			});
     
    			if(settings.effect == 'random'){
    				var anims = new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade");
    				vars.randAnim = anims[Math.floor(Math.random()*(anims.length + 1))];
    				if(vars.randAnim == undefined) vars.randAnim = 'fade';
    			}
     
                //Run random effect from specified set (eg: effect:'fold,fade')
                if(settings.effect.indexOf(',') != -1){
                    var anims = settings.effect.split(',');
                    vars.randAnim = $.trim(anims[Math.floor(Math.random()*anims.length)]);
                }
     
    			//Run effects
    			vars.running = true;
    			if(settings.effect == 'sliceDown' || settings.effect == 'sliceDownRight' || vars.randAnim == 'sliceDownRight' ||
    				settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft'){
    				var timeBuff = 0;
    				var i = 0;
    				var slices = $('.nivo-slice', slider);
    				if(settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') slices = $('.nivo-slice', slider).reverse();
    				slices.each(function(){
    					var slice = $(this);
    					slice.css('top','0px');
    					if(i == settings.slices-1){
    						setTimeout(function(){
    							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
    						}, (100 + timeBuff));
    					} else {
    						setTimeout(function(){
    							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
    						}, (100 + timeBuff));
    					}
    					timeBuff += 50;
    					i++;
    				});
    			} 
    			else if(settings.effect == 'sliceUp' || settings.effect == 'sliceUpRight' || vars.randAnim == 'sliceUpRight' ||
    					settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft'){
    				var timeBuff = 0;
    				var i = 0;
    				var slices = $('.nivo-slice', slider);
    				if(settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') slices = $('.nivo-slice', slider).reverse();
    				slices.each(function(){
    					var slice = $(this);
    					slice.css('bottom','0px');
    					if(i == settings.slices-1){
    						setTimeout(function(){
    							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
    						}, (100 + timeBuff));
    					} else {
    						setTimeout(function(){
    							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
    						}, (100 + timeBuff));
    					}
    					timeBuff += 50;
    					i++;
    				});
    			} 
    			else if(settings.effect == 'sliceUpDown' || settings.effect == 'sliceUpDownRight' || vars.randAnim == 'sliceUpDown' || 
    					settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft'){
    				var timeBuff = 0;
    				var i = 0;
    				var v = 0;
    				var slices = $('.nivo-slice', slider);
    				if(settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') slices = $('.nivo-slice', slider).reverse();
    				slices.each(function(){
    					var slice = $(this);
    					if(i == 0){
    						slice.css('top','0px');
    						i++;
    					} else {
    						slice.css('bottom','0px');
    						i = 0;
    					}
     
    					if(v == settings.slices-1){
    						setTimeout(function(){
    							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
    						}, (100 + timeBuff));
    					} else {
    						setTimeout(function(){
    							slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
    						}, (100 + timeBuff));
    					}
    					timeBuff += 50;
    					v++;
    				});
    			} 
    			else if(settings.effect == 'fold' || vars.randAnim == 'fold'){
    				var timeBuff = 0;
    				var i = 0;
    				$('.nivo-slice', slider).each(function(){
    					var slice = $(this);
    					var origWidth = slice.width();
    					slice.css({ top:'0px', height:'100%', width:'0px' });
    					if(i == settings.slices-1){
    						setTimeout(function(){
    							slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
    						}, (100 + timeBuff));
    					} else {
    						setTimeout(function(){
    							slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed);
    						}, (100 + timeBuff));
    					}
    					timeBuff += 50;
    					i++;
    				});
    			}  
    			else if(settings.effect == 'fade' || vars.randAnim == 'fade'){
    				var i = 0;
    				$('.nivo-slice', slider).each(function(){
    					$(this).css('height','100%');
    					if(i == settings.slices-1){
    						$(this).animate({ opacity:'1.0' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
    					} else {
    						$(this).animate({ opacity:'1.0' }, (settings.animSpeed*2));
    					}
    					i++;
    				});
    			}
    		}
    	};
     
    	//Default settings
    	$.fn.nivoSlider.defaults = {
    		effect:'random',
    		slices:15,
    		animSpeed:500,
    		pauseTime:3000,
    		startSlide:0,
    		directionNav:true,
    		directionNavHide:true,
    		controlNav:true,
    		controlNavThumbs:false,
            controlNavThumbsFromRel:false,
    		controlNavThumbsSearch:'.jpg',
    		controlNavThumbsReplace:'_thumb.jpg',
    		keyboardNav:true,
    		pauseOnHover:true,
    		manualAdvance:false,
    		captionOpacity:0.8,
    		beforeChange: function(){},
    		afterChange: function(){},
    		slideshowEnd: function(){}
    	};
     
    	$.fn.reverse = [].reverse;
     
    })(jQuery);

    Line 23 is this: return this.each(function() {

    I didn't notice anyone else with the same problem for IE7, so I haven't ruled out it's something my end I have done. If anyone could test it their side on IE7 that would be great.

    Thanks

    Edit: BTW, I am using IE Tester for testing purposes.

  6. #6
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I ran the page in a native IE7 and it also gets the error. Rules out any issues with IE Tester. My error also says "Char: 1".

    Ran the above code through JSLint. Nothing that should trip up IE.

    I'm thinking it runs that function (the this.each(function)) and either IE is tripping up on "this" (jQuery takes care of IE's usual bug with "this" though) or any of the values coming out of that function (some are ' ' and some are "false") and maybe IE is puking on any of those??

    Maybe temporarily make only integers and strings as possibilities inside the vars object and see if IE stops complaining at that spot (this should break your whole script, but it's just a test to see if it's really vars' properties that are hitting it).

  7. #7
    SitePoint Zealot west end lane's Avatar
    Join Date
    Mar 2010
    Location
    London, U.K.
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Stomme poes, thanks for looking at this again.

    I'm a bit unsure as to what parts I need to remove, could you explain a little more please?

  8. #8
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I'm still feeling my way into Javascript, so I'm likely wrong, but this was what I was thinking of.

    Code:
                var vars = {
                    currentSlide: 0,
                   // currentImage: '',
                    totalSlides: 0,
                  //  randAnim: '',
                  //  running: false,
                  //  paused: false,
                 //   stop:false
                };
    I'm starting to think the place where IE is stating the error isn't really where it's hitting an error, though.

  9. #9
    SitePoint Zealot west end lane's Avatar
    Join Date
    Mar 2010
    Location
    London, U.K.
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just gave that a go but still got the error.

    Does seem strange that it runs fine in IE8 but not 7, or is this quite common?

    I think your right that the error lies somewhere else than what IE is saying.

    Very strange.

    Oh, and congrats on beating the Brazilians!

  10. #10
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I couldn't believe it; it was incredible. Fr*cking Brasil!

    Microsoft improves the Javascript engine of each version of Internet Explorer: IE6 has a different one from IE7 who has a different one from IE8. For this reason those IE-emulators sometimes have warnings: Tredosoft IE's for example have all versions using the engine of whatever your newest IE is. I use a native IE6 for JS testing for that reason.

    So, it does make sense for IE8 to be different from 7 regarding a script problem.

    Was this script copy-pasted from the site? Is it an idea to delete and recopy new?

  11. #11
    SitePoint Zealot west end lane's Avatar
    Join Date
    Mar 2010
    Location
    London, U.K.
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    I couldn't believe it; it was incredible. Fr*cking Brasil!

    Microsoft improves the Javascript engine of each version of Internet Explorer: IE6 has a different one from IE7 who has a different one from IE8. For this reason those IE-emulators sometimes have warnings: Tredosoft IE's for example have all versions using the engine of whatever your newest IE is. I use a native IE6 for JS testing for that reason.

    So, it does make sense for IE8 to be different from 7 regarding a script problem.

    Was this script copy-pasted from the site? Is it an idea to delete and recopy new?
    Was a great result. And my money is on you to get past Uruguay, then in the final anything can happen! Germany do look very strong though..

    Well, I took out an older packed version (1.6) and replaced it with a fresh download of the latest version unpacked (2.0).

    In fact I just deleted the whole link and file and replaced with new and the error is still there.

    At a bit of a loss with it right now. I'm trying to see if anyone else has come across this issue with this slider but nothing so far.

  12. #12
    SitePoint Zealot west end lane's Avatar
    Join Date
    Mar 2010
    Location
    London, U.K.
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cracked it

    It was a single comma at the last function I left in by mistake
    (pauseonhover:false).

    Cheers for your help

    Edit: Also I can see why it was missed, because I added those functions to the source code when the original js was packed.

    I guess I can just move those over to the js file now..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •