Log in

View Full Version : Step Carousel Viewer v1.9 overwrites page



jscheuer1
08-28-2010, 03:28 PM
1) Script Title: Step Carousel Viewer v1.9

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm

3) Describe problem: If for any reason this script is delayed or run after the page is loaded, the change from append() to document.write() will overwrite the page -

previous version:


setup:function(config){
//Disable Step Gallery scrollbars ASAP dynamically (enabled for sake of users with JS disabled)
$('head').append('<style type="text/css">\n#'+config.galleryid+'{overflow: hidden;}\n</style>')
jQuery(document).ready(function($){
config.$gallery=$('#'+config.galleryid)
stepcar . . .

current 1.9 version:


setup:function(config){
//Disable Step Gallery scrollbars ASAP dynamically (enabled for sake of users with JS disabled)
document.write('<style type="text/css">\n#'+config.galleryid+'{overflow: hidden;}\n</style>')
jQuery(document).ready(function($){
config.$gallery=$('#'+config.galleryid)
stepcar . . .

Since the script otherwise allows for AJAX importation, this eventuality (running after page load) is not only likely, I've seen implementations which use it.