There are a few more things that should be done to make the implementation cross browser. For the initialization function:
Code:
function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee2=document.getElementById("vmarquee2")
cross_marquee.style.left=0
marqueewidth=document.getElementById("marqueecontainer").offsetWidth
actualwidth=cross_marquee.firstChild.offsetWidth
cross_marquee2.style.left=actualwidth+4+'px'
cross_marquee2.innerHTML=cross_marquee.innerHTML
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}
Once this is done, we need to wrap everything in an additional div with overflow set to hidden and assure that the nobr tag follows immediately after (without even a new line) the span tag:
HTML Code:
<div style="overflow:hidden"><div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<span id="vmarquee" style="position: absolute; width: 98%;"><nobr>
<!--SCROLL CONTENT HERE-->
Don't forget to close the added div tag:
HTML Code:
</nobr>
</span><span id="vmarquee2" style="position: absolute; width: 98%;"></span></div>
</div>
Now the style needs just a little tweaking and we are done (additions red):
Code:
<style type="text/css">
#marqueecontainer{
position: relative;
width: 500px; /*marquee width */
height: 120px; /*marquee width */
background-color: black;
overflow: hidden;
border: 0px solid orange;
padding: 2px;
padding-left: 4px;
text-align:left;
}
#marqueecontainer img {
border-width:2px;
border-style:solid;
}
</style>
Bookmarks