View Full Version : Browser 'back' button changes Conveyor Slideshow behaviour
nevdev
03-28-2006, 12:49 PM
Using the Conveyor Belt slideshow script, I notice that when I use the browser's 'back' button to return to a page which has the script on, the image scrolling suddenly speeds up. If I go forward in the browser once more, and then back again, the scrolling has stopped! Reloading a page which has speeded up or which has stopped returns the scrolling to normal, but obviously this is not right. What may be causing it? Is there any way to stop this?
nevdev
03-28-2006, 04:35 PM
Weird: if I download the original script, unaltered, and try it, this "back button behaviour" always occurs, either slowing or speeding up, stopping the slideshow altogether - yet I can't reproduce the problem with the demo on the DD website - though I can't see any differences in code! Is there some code on the website that relaunches the slideshow somehow that I haven't got??
I'd really like to iron this out if I could. Thanks in advance for any help on this!!
jscheuer1
03-28-2006, 06:59 PM
What browser are you using? Please give us a link to the problem page.
nevdev
03-28-2006, 10:50 PM
After a browser test I can confirm that this is a bug present only in Safari on Mac OS X. It doesn't occur on FF/Mac/Win or IE6/Win.
Safari users should see it here:
http://www.glastonburymagic.com/guests/conveyor/index.html
nevdev
03-28-2006, 11:46 PM
I've just realised, however, that the slideshow running on the demo page at:
http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm
...does NOT show this bug in Safari. So is it my code? Or some additional code in the demo page? :confused:
jscheuer1
03-29-2006, 06:45 AM
Most likely it is something with your implementation. Unfortunately, I have no Mac to test on. The way I would troubleshoot something like that is to remove everything from the page except the script and its markup and then slowly add things back in until the problem showed itself.
nevdev
03-29-2006, 12:14 PM
I copied all the demo page code, changing only the slideshow image references, and uploaded that to my server. Result - the bug's gone. It is, therefore, as I suspected, stopped by some extra code outside of the script in the demo page. So I'll now try to discover what that is!
nevdev
03-29-2006, 03:43 PM
Well now I have something interesting, and frankly, bewildering to me.
I have made two web pages: Page A, and Page B. Both have the slideshow.
Page A exhibits the bug I described above. Page B does not, and works flawlessly.
Both pages have exactly the same code on the page, except that Page B has an additional fragment of the conveyor demo source code, underneath the slideshow. (I took away more and more of the demo source code until I found the fragment that stopped the bug.)
If this fragment is put underneath the slideshow (as in Page B), it will work bug-free in Safari, but if it's not there (as in Page A), it will show the bug I described.
The fragment is simply this:
<script type="text/javascript"><!--
google_ad_client = "pub-3356683755662088";
google_ad_width = 468;
google_ad_height = 15;
google_ad_format = "468x15_0ads_al";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "3333FF";
google_color_url = "999999";
google_color_text = "000033";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
Now can someone give me a clue why adding that meaningless bit of javascript underneath the slideshow gets rid of the bug in Safari???
Page A, that doesn't have this fragment, and therefore shows the bug, can be seen here (http://glastonburymagic.com/guests/conveyor/index.html).
Page B, which differs only by having this fragment added after the script, and which therefore works, can be seen here (http://glastonburymagic.com/guests/conveyor/index3.html).
Someone tell me what's going on!!! :confused: :confused: :confused:
I can't see it (no Safari, running Linux; doesn't occur on Konqueror), but if what you described is true then it's probably a browser bug. File it with Apple's bug-report system (if they have such a thing).
nevdev
03-29-2006, 04:16 PM
...it's probably a browser bug. File it with Apple's bug-report system (if they have such a thing).
They have, and I have reported it. However, can anyone suggest a harmless small (and obviously invisible) javascript that I can include after the script for Safari users, that might mimic the fragment's effect?
It's probably due to the iframe said script writes. I don't know if an invisible iframe would work, though, if the problem was with rendering. Try:
<iframe src="http://www.google.com/" style="width:0;height:0;border-style:none;"></iframe>
jscheuer1
03-29-2006, 04:42 PM
It's probably due to the iframe said script writes. I don't know if an invisible iframe would work, though, if the problem was with rendering. Try:
<iframe src="http://www.google.com/" style="width:0;height:0;border-style:none;"></iframe>
If that works, try the less intensive:
<iframe src="" style="width:0;height:0;border-style:none;"></iframe>
You can even give it dimensions and set its visibility:hidden; in the style, if need be:
<iframe src="" style="width:10px;height:300px;visibility:hidden;"></iframe>
nevdev
03-29-2006, 05:41 PM
Twey and jscheuer1 - you guys are brilliant!
All your fixes work! The bug disappeared!
Many many thanks for your help and advice! :)
(The "Twey-jscheuer1 hack for Safari"!)
If they all work, the preferred one is:
<iframe src="" style="width:0;height:0;border-style:none;display:none;"></iframe>
nevdev
03-29-2006, 06:07 PM
If they all work, the preferred one is:
<iframe src="" style="width:0;height:0;border-style:none;display:none;"></iframe>
Actually that does not work. Using that, the bug reappears. However, this works:
<iframe src="" style="width:1px;height:1px;visibility:hidden;"></iframe>
..which is good enough for me! Thanks again!
Interesting. Does it work if you use a div instead of an iframe?
nevdev
03-29-2006, 06:35 PM
Interesting. Does it work if you use a div instead of an iframe?
No. It seems to need the "src=" part.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.