Slide div

Hello, I have a div with an image in it, without text. I would like to make the div slide from position:relative; left:300px backwards to left:10px OnLoad…

I have looked around at different slide options online and it looks like all seem too complicated for this simple task. Does anyone know the js to make my “slideout” id move horizontally to the left?

Thanks in advance

You perform such moves by adjusting the CSS properties of the element.

To animate a slide in javascript you need to use setTimeout or setInterval, so that on a certain time interval (such as 30 milliseconds) you can adjust the left property of the element so that it’s closer to where you want it to be.

Yes, the process can be complicated, which is why some libraries include animation methods to help simplify the development process.

Do you have a code library in mind for this, such as jQuery or YUI?

Paul, I know very little js, and a little jquery. I would assume either library, as long as it works cross-browser. Where can I find a tutorial on this specific setup? Thanks

The jQuery’s animate page has the details you should need.

Thanks. Checking into it now…