Reputation: 2265
I know there are various solutions out there, including JQuery solutions, that will do this, but I was trying to write my own simple version...
I want to hide a <div>
but sliding it off the left or right of the screen.
For some reason I'm unable to read and set the .style.left
value of my div
though.
This fiddle shows the problem: http://jsfiddle.net/47MNX/3/
Upvotes: 0
Views: 75
Reputation: 207963
Seems to work fine if you set the position property, e.g. position:absolute;
(or relative) to #myLeftMenu
. You never set the position, so while the JavaScript was running it had no way to make the change.
Upvotes: 4