Hello
Will any one can explain how to produce numbers(1-50) randomly in Java script..and that if the number =27 let an image become visible...Thanks
Printable View
Hello
Will any one can explain how to produce numbers(1-50) randomly in Java script..and that if the number =27 let an image become visible...Thanks
ummmm, that'd be a sinch in PHP, why u wanna use JS ? :p
use math.random i think
LOL ubunreal mayb he doesn't know PHP? ;) or mayb he does and is lazy
depending on what he is making php could be a completely ridiculous choice
I had a good random number seed thingy happenin' on a page I made...
Gimme 2 secs to find it...
Oh well... so much for that idea... I seem to have replaced it with an ASP version... :p
is that some sort of sick twisted joke :p
What? What is sick?Quote:
Originally posted by sail3005
is that some sort of sick twisted joke :p
MEh, I don't get it... :(
<html>
<head>
<title></title>
<script>
function random( ){
return Math.round(Math.random()*50);
}
function showPic( ){
if(random( ) == 27)
myPic.style.visibility = 'visible';
}
</script>
</head>
<body ONLOAD = "showPic( );">
<img SRC = "pic.jpg" ID = "myPic" STYLE = "visibility:hidden;">
</body>
</html>