Jump to content

Marquee


garyblackpool
 Share

Recommended Posts

Yeah i have got that. Okay i have an idea of how it would work- i have a div container with overflow hidden and set to no-wrap. I read the innerHtml; move the <p> and append a child element when it gets to a certain and then delete the one which has gone out of view. And repeat the process.Is that how it should be done or am i making it a bit more complicated than necessary?Thanks.Gary

Link to comment
Share on other sites

I'd just have one element inside the <div>. Move the element until its position is as far outside the box as its width (a negative number). You can get the position using offsetLeft and the width with offsetWidth.Once you know it's outside of the box, set the position to the width of the container (offsetWidth of the parent <div>), that puts it right outside the right end of the container.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...