garyblackpool Posted December 4, 2009 Share Posted December 4, 2009 Hi i have been looking around for a javascript function which is like marquee. but unfortunatly i am not really able to find anything could someone help thanks. Link to comment Share on other sites More sharing options...
Ingolme Posted December 4, 2009 Share Posted December 4, 2009 Learn how to use the setTimeout() function to make an element change its position on each interval of time.You can check out this example to see how you can make things move. Link to comment Share on other sites More sharing options...
garyblackpool Posted December 4, 2009 Author Share Posted December 4, 2009 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 More sharing options...
Ingolme Posted December 5, 2009 Share Posted December 5, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.