Now that I take a quick look at this, perhaps number 1 is not so difficult as I imagine. However, it will break down on a high resolution monitor where the width of the window is wider than the train of images. This will not be a problem if your train of images is wider than say - 2048 pixels, at least that would be good for most monitors. Failing that, a max-width/expression can be specified. Here's how -
Set the motioncontainer's width to 100%:
Code:
<div id="motioncontainer" style="position:relative;width:100%;height:150px;overflow:hidden;">
If using a max-width/expression (recommended) where the two red 800's represent the maximum width for the gallery:
Code:
<div id="motioncontainer" style="position:relative;width:100%;max-width:800px;width:expression(Math.min(this.offsetWidth, 800)+'px');height:150px;overflow:hidden;">
Next, change this line in fillup():
Code:
menuwidth=parseInt(crossmain.style.width)
to:
Code:
menuwidth=crossmain.offsetWidth
Finally, to accommodate users who may resize their screens and/or windows after loading the page, add this code after the line shown, just before the closing </script> tag (addition red):
Code:
window.onload=fillup
onresize=function(){
menuwidth=crossmain.offsetWidth
cross_scroll.style.left=menuwidth-actualwidth+'px'
}
</script>
If using the max-width/expression (recommended), make it instead:
Code:
window.onload=fillup
onresize=function(){
if (typeof motioncontainer!=='undefined'&&motioncontainer.filters){
motioncontainer.style.width="0"
motioncontainer.style.width="100%"
motioncontainer.style.width=Math.min(motioncontainer.offsetWidth, 800)+'px'
}
menuwidth=crossmain.offsetWidth
cross_scroll.style.left=menuwidth-actualwidth+'px'
}
</script>
Note: The red 800 should be the same number you used in the max-width/expression for the motioncontainer division (see code block second from top)
Bookmarks