I'm having a tough time with this. I would like to scroll a div from left to right accross the browser window no matter what size the window is. I'm have a problem with the syntax, I think my logic is correct.
I get the screen size and place it in a var,
I place the div off the left side of the screen with css,
I animate the div accross the screen using the screen value + the div size so that it will clear the right side of the screen completely,
I then animate it back to its starting position by taking the screen size and subtrackting it from itself and subtract the div width, so this should place the div back where it began, off the left side of the screen. This way I can scroll the div from left to right no matter what the screen or browser size is.
Below is my code for one div but obviously my syntax is very wrong, I just typed it like this to illistrate it and because I have no clue how to do it correctly. Any help would be greatly appreciated.
the logic looks fine, you just need to add () after $(window).width and replace & with $ in cloud1 function. the second animate can be replaced with .css("left",-450+"px") to place it back in original position.
One issue though. what happens when the window gets resized?
Okay so I gave it try and made the changes you suggested but nothing is happening yet, I tried running it in jsFiddle as well but zip, what else am I doing wrong? This is what the code looks like now, I'm not touching the screen resize until I have this working correctly.