Click to See Complete Forum and Search --> : marquee


autocolismo
06-27-2005, 01:31 PM
yo,

i'm starting to $_GET an Heart Attack :).
It's a SMALL problem with an marquee.

The thing is: i have a site where i use a marquee, the whole site is in index.php in wich i include other files as needed. When i click a link the marquee start's again at position "0" (of course).
So it's a little boring seeing it starting all over again.

I'm tired of reanding and searching. The best thing so far is setting scrollLeft.


<marquee name="test" id="test" scrollAmount="2" scrollLeft="<?php echo $_GET['pos'];?>">marquee text</marquee>


But this doesn't work, the marquee goes to the position desired, then right back to the begining.

After 15547898 beers i saw the light... :D
I could set scrollAmount to that desired value, at the first move the marquee goes to the desired position the set the scrollAmount to "2" again.

It should work.
But how do i make it work??? :s
something like this:

<script language="javascript">
pos(<?php echo $_GET['pos'];?>);


function pos(ya) {

if (test.scrollLeft < ya) {
test.scrollAmount = ya
}
// after the marquee moves set the scrollAmount back to 2
test.scrollAmount = 2;
//doesn't work... of course :s
}
</script>


If anyone can help me i would apreciate, untill then i'll keep drinking to find a solution :)

autocolismo
07-04-2005, 10:34 AM
Found a solution
Example:


<script language="JavaScript" type="text/JavaScript">
function MM_goToURL() {
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function move(x) {
mar.scrollAmount = x;
}

setTimeout('move("<?php echo $_GET['u'];?>")',0100);
setTimeout('move("2")',0200);

</script>
<marquee name="mar" id="mar">lkjlskaj dlkjasldk joaius duh ilhgvljfg lifusdliuh flgjhlkshdlfj gjgçlskdhf dugh ugh iuhoiuh ohbdsoifbgi oi h siudhfoi goiuhsiouhd foiuh giu hsdoifuhio suhgiosudfhgoiusdh ioguhds oiuhsdfihg sgsdf gsdfg sf</marquee>
<a href="#" onMouseUp="MM_goToURL('parent','<?php echo $_SERVER['PHP_SELF'];?>?u='+mar.scrollLeft);return document.MM_returnValue">test link</a>