Jump to content

Mewanto

Members
  • Posts

    3
  • Joined

  • Last visited

Mewanto's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. before you show me onmouseover=\"makeBigger(this);\", i used this call but i forgot to \" \" and it never work.Thank you so much.Now i got new idea, what should i do if i want the 3 image not changing the size and creating a new size image below the <p>Click Refresh (or Reload) to run the script again</p>. thank you in advance LittleSam and other
  2. Hello Javascript Guru,Currently, i am trying to use onMouseOver but i dont know how should i put inside my coding. if anyone good at JS Event, please give me a point out. i am so blur right now. My javascript coding is random 3 images. I would like to use onMouseOver on any of the images and then when onMouseOver is true, it will create new picture and the size is bigger than width = \"105\" height = \"100\"Thank you in advance. I am really want to know how to do it. Always learn for fun and from mistake Have a nice day<?xml version = "1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title>Random Image Generator</title> <script type = "text/javascript"> <!-- randomPic(); function load() { window.status="Page is loaded" } function randomPic() { var pictures1 = [ "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9" ]; picArray1 = pictures1[Math.floor( Math.random() * 9)]; firstPic = "<img src = \"" + picArray1 + ".jpg\" width = \"105\" height = \"100\" />"; var pictures2 = [ "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9" ]; picArray2 = pictures2[Math.floor( Math.random() * 9)]; secondPic = "<img src = \"" + picArray2 + ".jpg\" width = \"105\" height = \"100\" />"; var pictures3 = [ "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9" ]; picArray3 = pictures3[Math.floor( Math.random() * 9)]; thirdPic = "<img src = \"" + picArray3 + ".jpg\" width = \"105\" height = \"100\" />"; document.writeln(firstPic); if (picArray1 == picArray2) { while (picArray1 == picArray2) { picArray2 = pictures2[Math.floor( Math.random() * 9)]; secondPic = "<img src = \"" + picArray2 + ".jpg\" width = \"105\" height = \"100\" />"; } document.writeln(secondPic); } else { document.writeln(secondPic); } if ((picArray1 != picArray3) && (picArray2 != picArray3)) { document.writeln(thirdPic); } else { while ((picArray1 == picArray3) || (picArray2 == picArray3)) { picArray3 = pictures3[Math.floor( Math.random() * 9)]; thirdPic = "<img src = \"" + picArray3 + ".jpg\" width = \"105\" height = \"100\" />"; } document.writeln(thirdPic); } } // --> </script> </head> <body onload="load()"> <p>Click Refresh (or Reload) to run the script again</p> </body></html>
×
×
  • Create New...