There is a problem with using percentages with this and many other scripts. The initialization of the script relies upon pixel dimensions. Percentage can be converted to pixels but, in order to behave like a true percentage width, the page must be reloaded when resized, like the way a percentage width changes when a window is resized. If reloading your page when resized will not cause other problems, simply insert this unit into the current script, just below the do not edit line:
Code:
var ie=document.all && !window.opera
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
if (((typeof(window.onresize))==('object')||('undefined'))&&(sliderwidth.indexOf('%')!==-1))
window.onresize=refresh;
function refresh() {
setTimeout("doit()",1)
}
function doit(){
if (window.location.reload)
window.location.reload( true );
else if (window.location.replace)
window.location.replace(unescape(location.href))
else
window.location.href=unescape(location.href)
}
if (sliderwidth.indexOf('%')!==-1)
var sliderwidth=ie? (iecompattest().clientWidth*parseInt(sliderwidth)/100)-20+'px' : (window.innerWidth*parseInt(sliderwidth)/100)-20+'px'
Then the script will accept percentage widths and behave accordingly.
Bookmarks