PDA

View Full Version : Swiss Army Slide Show won't advance manually in Chrome Browser



gtraeber
02-27-2013, 05:10 PM
Individual slides have link to html page on webserver. Show is manual and configured as shown on the examples in slideshow 3. Moving through the slide show using the next and previous arrows works in IE and Firefox but not Chrome.

A specific line in the slides definition looks like this :
slides[6] = ["/drpano/jpg/FMM_Previous.jpg", "", "/drpano html/DrPanoBuyFMM.html"];

This works fine in IE and Firefox but not Chrome. The Chrome browser throws this error:
Uncaught SyntaxError: Unexpected number swissarmy.js:199
inter_slide.populateslide swissarmy.js:199
inter_slide.changeimg swissarmy.js:304
onclick DrPanoViewPrevious.html:114

Removing the second argument, "" , from the slides definition allows all browsers to cycle through the show but the individual slide link does not work in any browser. I probably have missed the simple or obvious way to get this to work in Chrome. Any help is greatly appreciated.

Thanks,

George Traeber

jscheuer1
02-27-2013, 05:34 PM
It could be something you're doing, or the script might need an update. Chrome did not exist when the script was written. However the demo page's example 3 works fine in Chrome here. To tell what the problem is I would need a link to the page:

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

gtraeber
02-27-2013, 07:21 PM
Thanks for the quick reply, here's a link to the problem page:

http://www.drpano.com/DrPanoViewPrevious.html

jscheuer1
02-27-2013, 08:49 PM
This (red in the highlighted section) is invalid javascript code (from the page's source code):


. . . se_title=1; //use for descriptions as images title attributes
slides.nofade=1; //use for no fade-in, fade-out effect for this show
slides_border_style='ridge';
slides.border=5; //set border width for images
slides.border_color='#E4D6BB'; //set border color for images
slides.onclick="window.open(this.1,this.2,'top=0,left=0,width=+screen.availWidth+,height='+screen.availHeight');return false;"

</script>

<script src="/drpano/js/swissarmy.js" type="text/javascript">

/***********************************************
* Swiss Army Image slide show script - John Davenport Scheuer: http://home.comcast.net/~jscheuer1/
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynam . . .

Other browsers just go with 'undefined' for those values. But technically speaking there's no this.1 or this.2, and even if there were, they should be expressed as this[1] and this[2]. Chrome gets excited about it and stops processing the rest of the script. Why it doesn't do that sooner, I'm not sure. But it does do it and does it as soon as you try to go to the next or previous slide from second slide.

OK, so do you want it to open a new window? Right now other browsers are looking at that, and when you click on it they're ignoring it because it's an error, and they're just taking you to the page. If that's what you want, just get rid of the whole line, so you would have:


. . . se_title=1; //use for descriptions as images title attributes
slides.nofade=1; //use for no fade-in, fade-out effect for this show
slides_border_style='ridge';
slides.border=5; //set border width for images
slides.border_color='#E4D6BB'; //set border color for images


</script>

<script src="/drpano/js/swissarmy.js" type="text/javascript">

/***********************************************
* Swiss Army Image slide show script - John Davenport Scheuer: http://home.comcast.net/~jscheuer1/
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynam . . .

If you want a new window, with those coordinates (top of the screen and left of the screen) and those dimensions (all of the available screen width, and all the available screen height), then use:


slides.onclick="window.open(this.href,'_new','top=0, left=0, width='+screen.availWidth+', height='+screen.availHeight);return false;";

If it were me, I'd just get rid of the line, or possibly use a new window, but a smaller one, like:


slides.onclick="window.open(this.href,'_new','top=50, left=50, scrollbars, resizable, width='+(screen.availWidth/1.5)+', height='+(screen.availHeight/1.5));return false;";

gtraeber
02-27-2013, 10:12 PM
John;

Thanks for your effort on my problem. I would have probably looked forever and never realized my mistake. Removed the line completely and Chrome is now working properly.

Again, Thanks

George Traeber