PDA

View Full Version : Fast forward button for scrolling text



fulham7
05-31-2009, 12:32 PM
On my home page - www.stonecricketclub.co.uk i have scrolling text. I like the speed it goes but i was wondering if there is script you can use so you can add a button either side that you can view fast forward it and rewind it


Would really appreciate expert knowledge :)

clueful
06-01-2009, 12:56 AM
On my home page - www.stonecricketclub.co.uk i have scrolling text. Where exactly is this scrolling text? All I saw was a status line scroller on the Contacts page, and few will see that.

Nile
06-01-2009, 01:00 AM
It's on the exact page he linked us to, under everything.

clueful
06-01-2009, 01:17 AM
It's on the exact page he linked us to, under everything.That page performs a redirect within two seconds, so you don't get a chance to see it, let alone press a button.

Nile
06-01-2009, 01:48 AM
When the page is about to redirect, press the stop button, probably next to the navigation bar (at the top of your browser).

clueful
06-01-2009, 03:14 AM
On my home page - www.stonecricketclub.co.uk i have scrolling text. I like the speed it goes but i was wondering if there is script you can use so you can add a button either side that you can view fast forward it and rewind it
Marquee is non-standard, so not all browsers will respond to this:

<html><body>
<marquee id='mq' scrolldelay="50" align="middle" width="621" height="19" scrollamount="3" style="font-family: 'Adobe Garamond Pro'; font-size: 12pt; color: #000000; background-color: #FFFFFF; text-decoration: blink; text-align: justify; border-style: solid; border-color: #FFFFFF" bgcolor="#FFFFFF">
Stone Cricket Club Beer Festival 19th June for tickets please email <a href="mailto:beerfestival@stonecricketclub.co.uk">beerfestival@stonecricketclub.co.uk</a>..........A rare fifty from Peter Booth (60) alongside a fine all-round bowling performance helps Stone to a 19-run victory over Tewkesbury.

A debut senior fifty for young Richard Boroughs (62*) and 43 from veteran Keith Driver is not enough to see Stone IIs avoid a 47-run defeat at the hands of Tewkesbury's talented second string.
</marquee><br>
<span id='speed'> [TURBO SCROLL] </span> <span id='rev'> [Fwd/Reverse] </span>

<script type='text/javascript'>

function marqueeControl( mqId, factor, speedId, revId )
{
var scroller = document.getElementById( mqId ),
turbo = document.getElementById( speedId ),
reverser = document.getElementById( revId ),
defRate = scroller.scrollAmount,
tLocked = false;

if(scroller.direction == null)
scroller.direction = 'left';

turbo.onmouseover = function(){ scroller.scrollAmount *= factor; };
turbo.onmouseout = function(){ if( !tLocked ){ scroller.scrollAmount = defRate;} };
turbo.onclick = function(){ tLocked ^= true; };

reverser.onmouseover = function(){ scroller.direction = ( scroller.direction == 'left' ? 'right' : 'left' ); };
}

marqueeControl('mq', 5, 'speed', 'rev');

</script>
</body>
</html>

fulham7
06-01-2009, 10:03 AM
Ahh i see thats great.

Yeah i know im not actually going to use it on that page anymore.

How would you have it so there both turbo but going different directions?

so

(REVERSE) (FASTFORWARD)

Reverse goes right
Fastforward Goes left

Regards

Thanks for the help!!

clueful
06-01-2009, 11:54 AM
How would you have it so there both turbo but going different directions?

so

(REVERSE) (FASTFORWARD)

Reverse goes right
Fastforward Goes left


<a href='#' id='speed'> &lt;&lt; </a> <a href='#' id='rev'> &gt;&gt; </a>

<script type='text/javascript'>

function marqueeControl( mqId, factor, speedId, revId )
{
var scroller = document.getElementById( mqId ) || badElem( mqId ),
turbo = document.getElementById( speedId ) || badElem( speedId ),
reverser = document.getElementById( revId ) || badElem( revId ),
defRate = scroller.scrollAmount;

turbo.onmouseover = function(){ scroller.scrollAmount = defRate * factor; return false; };
turbo.onmouseout = function(){ scroller.scrollAmount = defRate; return false; };
reverser.onmouseover = function(){ scroller.direction = 'right'; turbo.onmouseover(); return false; };
reverser.onmouseout = function(){ scroller.direction = 'left'; turbo.onmouseout(); return false; };

function badElem( id ){ alert('Element "' +id+ '" not found'); return {}; }
}

marqueeControl('mq', 5, 'speed', 'rev');

</script>

fulham7
06-01-2009, 04:14 PM
FANTASTIC!

Thats awesome

Any idea why it overlaps on my main page?

Have a look you will catch my drift

http://www.stonecricketclub.co.uk/Latestnews.html

Regards

clueful
06-01-2009, 04:48 PM
Any idea why it overlaps on my main page?
Probably because the <span> is closed in the wrong place.

fulham7
06-01-2009, 06:21 PM
Tryed everything with the span even removed it and it didnt make a dif

Any other ideas?

Regards

clueful
06-02-2009, 04:46 PM
Tryed everything with the span even removed it and it didnt make a dif

Any other ideas?Jut remove the width attribute, then it should assume 100% of its container.

fulham7
06-02-2009, 09:26 PM
didnt work im afraid

any other ideas??

Strange one

regards

clueful
06-02-2009, 10:49 PM
didnt work im afraid

any other ideas??

Strange one

regardsWell I made a copy of that page, and removing the width attribute stopped the marquee overlapping.