Efecto Rebote

Códigos de utilidad para hackers.
admin
Site Admin
Mensajes: 10
Registrado: Sab Nov 30, 2019 10:50 am

Efecto Rebote

Mensaje por admin » Dom Dic 01, 2019 1:18 pm

Aquí tenéis un código html con efecto rebote.

Podeis ver la demo aquí: http://www.ciberterror.com/demos/rebote.html

Código: Seleccionar todo

<html> 
   <head> <html lang="es" dir="ltr" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#" xmlns:article="http://ogp.me/ns/article#" xmlns:book="http://ogp.me/ns/book#" xmlns:profile="http://ogp.me/ns/profile#" xmlns:video="http://ogp.me/ns/video#" xmlns:product="http://ogp.me/ns/product#" class="js"><head profile="http://www.w3.org/1999/xhtml/vocab"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  

  <title>CIBERTERROR.COM</title>
 

</head>
<body>
<div align="center" id="staticBall" style="position:relative;visibility:visible">
<img src="https://www.neoesfera.com/wp-content/uploads/2018/02/google-earth-1-150x150.png" height=100 width=100 alt="Static ball">
</div>
</center>
<div id="ball" style="visibility:hidden; position:absolute; left:100; top:10; height:184; width:184">
<img src="https://www.neoesfera.com/wp-content/uploads/2018/02/google-earth-1-150x150.png" height=30 width=30 alt="Bouncing ball">
</div>
<script language="Javascript">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
iter = 0;
setId = 0;
down = true;
up = false;
var ns = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
ie=!ns;
bouncingBall =  document.getElementById("ball").style;
stillBall = document.getElementById("staticBall").style;
var winH ;//= (ns) ? window.innerHeight - 55 : document.body.offsetHeight - 55;
document.onmouseup = buttonUp;
if (ns)
document.captureEvents(Event.MOUSEUP);
function buttonUp(e) {
winH = (ns) ? window.innerHeight - 55 +window.scrollY: document.body.offsetHeight - 55 +document.body.scrollTop;
if ( ((ns) ? e.which : event.button) != 1) return true;
if (setId != 0) clearInterval(setId);
bouncingBall.visibility="visible";
stillBall.visibility="hidden";
bouncingBall.left = (ns) ? e.pageX - 15 : event.clientX - 15;
bouncingBall.top = (ns) ? e.pageY - 15 : event.clientY - 15+document.body.scrollTop;
iter = 0;
setId = setInterval("generateGravity()", 20);
return true;
}
function generateGravity() {
if ((parseInt(bouncingBall.top)+iter < winH) && down) {
bouncingBall.top = parseInt(bouncingBall.top) + iter;
iter++;
return;
}
else {
if ((parseInt(bouncingBall.top)< winH) && down) {
bouncingBall.top = winH + 5;
return;
}
down = false;
up = true;
if (iter < 0 && parseInt(bouncingBall.top) > winH) {
clearInterval(setId);
bouncingBall.visibility = "hidden";
stillBall.visibility="visible";
setId = 0;
}
if (parseInt(bouncingBall.top) > 0 && up && iter >= 0) {
bouncingBall.top = parseInt(bouncingBall.top) - iter;
iter--;
if (iter%3 == 0) iter--;
return;
}
down = true;
up = false;
   }
}
// End -->
</script>
<center><h2> Haz click en la imagen de arriba</h2></center>
<br/><center><div style="clear:both"></div><div><a target="_blank" href="http://www.ciberterror.com/"><span style="font-size: 8pt; text-decoration: none">Ciberterror.com | REBOTE DE IMAGEN</span></a></div></center>
</body>
</html>

Responder