Vida Una Homepage
Forum Home Forum Home > Programación > Códigos JavaScript
  New Posts New Posts RSS Feed - Mover ventana
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Mover ventana

 Post Reply Post Reply
Author
Message
Programador View Drop Down
Expert@
Expert@
Avatar

Joined: 09 Mayo 2009
Location: San Pedro Alc.
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Programador Quote  Post ReplyReply Direct Link To This Post Topic: Mover ventana
    Posted: 09 Mayo 2009 at 4:17pm
El siguiente JavaScript mueve una ventana a través de la pantalla:
 
<!-- PRIMER PASO: Colocar este javascript en la página mover01.htm -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function makeAd() {
  window.open("mover02.htm", "Mover", "width=468,innerWidth=468,height=80,innerHeight=80,left=0,top=0");
}
// -->
</SCRIPT>
<!-- SEGUNDO PASO: Colocar el botón que activa la ventan en la página mover01.htm -->
<form>
  <p><input TYPE="button" VALUE="Mover Ventana" onClick="makeAd()"></p>
</form>
<!-- TERCER PASO: Colocar este javascript en la página mover02.htm -->
<script LANGUAGE="JavaScript">
<!--
function startAd() {
  if (window.screen) {
    pos = 0;
    aw = screen.availWidth;
    window.moveTo(pos, 0);
    timerID = setInterval("moveAd()", 50);
  }
}
function moveAd() {
  if (pos <= 0) inc = 5;
  if (pos + 468 + 10 + 5 > aw) inc = -5;
  pos += inc;
  window.moveTo(pos, 0);
}
window.onload = startAd;
// -->
</script>
Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.266 seconds.