Log in

View Full Version : Looking for scroller with 100% width



anycall
09-06-2008, 12:40 PM
Hello!

I have an elastic design and can't find in www any marquee crossbrowser script with width not in pixels:confused: But may be anybody have that i need? I need script for sliding text news from right to left, tag <a> must be supported, on hover scrollable text must be frozen on unhover must scroll again. That's all:cool: P.S. This script must work with resizeble browser windows. Thank you:)

rangana
09-06-2008, 01:31 PM
Change the "fixed" width (px) in cross browser marquee script (http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm). It will suit your needs.

anycall
09-06-2008, 01:46 PM
Sure, that's most interesting script, but if i use percent in with field

//Specify the marquee's width (in pixels)
var marqueewidth="100%"

script does not work.. I don't know JavaScript and can't made calculation size of window on-the-fly for upgrading script.. Please, if you can, help:rolleyes:

anycall
09-07-2008, 09:18 AM
I was made simple changes to "Cross browser Marquee script", but please, tell me, that's a good solution? And one trouble - if i resize a window after loading script does not recalculating results:(
function getClientWidth()
{
return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}
var MyWidth = getClientWidth()- "120" + "px"



//Specify the marquee's width (in pixels)
var marqueewidth= MyWidth

rangana
09-07-2008, 02:47 PM
First, try to give your function another name, getClientWidth is a JS function. Try to rename it into: setWidth, and add an event to check if the window is resized (onresize):


window.onresize=setWidth;


Hope that helps.