- Create Account

Scroll forever like a news box.

Forums > Inline HV Scrollbox > Scroll forever like a news box.
Author
Message

1) Omar Valerio Minero Group: Guests
IP: 200.66.--.--
Hello Angus, hope you're doing good. I have to ask you something...

Briefly,  I saw the inline box script in your web, I like it and now Iīm trying to customize this same script for the following purpose.

I want to use this script in a news rotator, by gradually scrolling the box while page is being displayed.

I have work out the following solution...

// **** START  EDITING HERE ****

var  scr = new InlineScrollbox('scr');

var update; // (1) my timer
var y = 0; // (2)  starting position

var ilsOldOL = window.onload;
window.onload = function()
{
 if (ilsOldOL) ilsOldOL();

 scr.load('NEWS'); // (3)  the scroller I'm using
 // frequency of updates is 200 milliseconds
 update = window.setInterval("scrollToY()",200);
 
}

// this function call the one you provided with
// inline box script, increasing y by two each call
function scrollToY() {
 var inc = 2;
 scr.scrollTo(0,y);
y = y + inc;
}


Although as you can probably see I have a problem, when the box reach its bottom, I donīt have a way to notice this condition in order to start it over.

Hope you can give and advise on this one. Thank you.

Omar V.M.

P.S. : I  provide you with a testing link so you can look what I'm trying to do..

          http://www.prodigyweb.net.mx/ovalerio/inline.htm

2) Angus Turnbull Group: Guests
IP: 210.54.--.--
The scroller keeps an internal variable 'scrTop' which records the current scroll position. You could put in a test like this in the scrollToY() function after calling scrollTo():

if (y  - scr.scrTop > 2) y = 0;

That  is, if the difference is more than two, it must have reached the end, and you can reset Y to zero. I do this as scrTop may take be fractional values when accelerating/decelerating (so you can't use == ), but it should work.

Good luck - Angus.

3) Omar Valerio Group: Guests
IP: 148.233.--.--
Thank you Angus,

Now it looks much better, I hope I can finish my web soon so I can give you the credit for all this dynamic stuff.

Meanwhile I leave this link if anybody is interested in performing a similar modification to the inline scrollbox script....

          http://www.prodigyweb.net.mx/ovalerio/inline.htm

Omar V.M.

4) Angus Turnbull Group: Guests
IP: 210.54.--.--
Glad it worked, and best of luck for the rest :).

-  Angus.

5) Joe Evans Group: Guests
IP: 200.187.--.--
Hi, Angus, Hi, Omar

I have copied the modified script omar did, I have a tes page at

http://www.soundfiles.kit.net/forever.html

The problem is:

Evan copying the two first cells to the end of the sequence, there's a noticeable hiccup that I'd like to avoid. Could that be done, in order to get a permanent flow?

thanks.
Joe.

6) Angus Turnbull Group: Guests
IP: 210.54.--.--
Permanent flow is tricky as you have to jump back sometime. Try checking the scroller position versus the scroller height and junping back to the top slightly earlier? The variables you can use are scr.scrH (for the pixel height of the scroller), scr.scrTop (for the current scroll position) and scr.div.h() for the total scroller height, so do some math and decide when you want to jump back to the start until it looks right.

Good luck - Angus.

7) Joe Evans Group: Guests
IP: 200.187.--.--
Ok,

There's a scrolling "news box" at

http://www.galeriagourmet.com.br

that pauses on mouseover, and restarts on mouseout.

Do you think this can be implemented on your code?
Please, Is that really what i saw, a simple Marquee tag , but one that moves a table instead os a text line?
I tried here with no success...
help.Thanks,
Joe.

8) Angus Turnbull Group: Guests
IP: 210.54.--.--
Mine's a generic scroller. Perhaps in the next version I might implement newsbox type scrolling built in but currently, unless you're willing to add mouse events to the code yourself, you're probably best to search for a specific newsticker type script. So yes, it can be implemented if you want, but you have to do the mouse detecting yourself.

I wouldn't use MARQUEE tags, they're largely IE-only (except some recent Mozillas perhaps), and definitely not standards-based at all.

- Angus.

9) Scooter Group: Guests
IP: 211.144.--.--
just follow the link(s) at the end of the scooter's description.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.