So, here's the deal, I'm trying to make an element move to the right. Here's my code
<p id="test01" onclick="animation();">Start Animation</p>
document.getElementById("test01").style.left = '0px';
document.getElementById("test01").style.left = parseInt(document.getElementById("test01").style.left) + 50 + 'px';
I've checked my Google Chrome de-bugger, and there's no errors that I can find. I'm not sure what I'm doing wrong, please help!
For style.left to work the element has to be positioned absolute.
FYI Jquery has better animation tools.
or fixed or relative. i would recommend relative if your page is not already using abspos.
|All times are GMT +1. The time now is 05:16 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.