Image Move To Lower Right Corner

[Total: 0    Average: 0/5]

This example has a HREF that upon a click will take the image on the top left and move it to the bottom right.

Body Code:

<script type=text/javascript src='http://www.js-examples.com/bin/basicstuff.js'></script>
<script type=text/javascript>
function movePic() {
  if (document.all) {
    document.all.d1.style.left = getWindowWidth() - 40 - 10;
    document.all.d1.style.top = getWindowHeight() - 40 - 10;
  } else {
    document.d1.style.left = getWindowWidth() - 40 - 10;
    document.d1.style.top = getWindowHeight() - 40 - 10;
  }
}
</script>
<div id=d1 style="position:absolute">
<img src='http://www.js-examples.com/js/pic1.gif' width=40 height=40 border=0 alt=''>
</div>
<a href=javascript:movePic()>click to move pic</a>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *