View Single Post
Old 08-13-2009, 05:26 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
This may help:-

Code:
<p id = "p1"  onclick = "moveRight()">Some text here for you to click on</p>

<script type="text/javascript">

var userWidth = window.screen.width;
function moveRight() {
var pp = document.getElementById("x");
var lft = parseInt(pp.style.left);
var tim = setTimeout("moveRight()",20);  // 20 controls the speed
lft = lft+5;  // move by 5 pixels
pp.style.left = lft+"px";
if (lft > userWidth + 10) {  // left edge of image past the right edge of screen
pp.style.left = -200;  // back to the left
clearTimeout(tim);
}
}


</script>

<img src="one.gif" id="x" style="position:relative;top:10px;left:-200px;"><br>


“Live like a candle which burns itself, yet gives light to others. Look backwards with gratitude, forward with hope, and upwards with confidence."

Last edited by Philip M; 08-13-2009 at 05:30 PM..
Philip M is offline   Reply With Quote