Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. javascript problem

javascript problem

Scheduled Pinned Locked Moved Web Development
javascriptcomdata-structuresperformancehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    samithas
    wrote on last edited by
    #1

    I want to create a javascript tha achoieves the fullowing functions 1. when page loads it shows images from random locations 2. Whenever the user click the mouse anywhere on the browser the images should be hidden 3. After some time duration diaplay the images again here is my code <!-- Cupid=new Image(); loaded =true; Cupid.src="bat.gif"; //specify path to bat image amount=3; //Number of cupids, minimum must be 3. Xpos=700; //cupids x coordinates, in pixel Ypos=200; //cupids y coordinates, in pixel step=0.3; //Animation speed (smaller is slower) dismissafter=15; //seconds after which Cupids should disappear, in seconds yBase=xBase=currStep=a_count=0; flycupid=0; b_count=1; c_count=2; d_count=3; move=1; var ns6=document.getElementById&&!document.all bats=new Array(3) if (document.layers){ //alert('start in if1'); for (i=0; i < amount; i++) { document.write("<LAYER NAME=n"+i+" LEFT=0 TOP=-50><a href='http://www.dynamicdrive.com'><IMG SRC='"+Cupid.src+"' NAME='nsi' width=69 height=60 border=0></a></LAYER>")} } else if (document.all||ns6) { document.write('<div id="out" style="position:absolute;top:0;left:0"><div id="in" style="position:relative">'); for (i=0; i < amount; i++) { if (document.all) { document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="msieBats" style="position:absolute;top:-50;left:0" border=0></a>') //alert('start in if2'); } else document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="ns6Bats'+i+'" width=69 height=60 style="position:absolute;top:-50;left:0" border=0></a>') } document.write('</div></div>'); } if (document.layers||ns6) { //alert('start in if3'); yBase=window.innerHeight/3; xBase=window.innerWidth/6; if (document.layers) window.captureEvents(Event.MOUSEMOVE); } if (document.all) { yBase = window.document.body.offsetHeight/3; xBase = window.document.body.offsetWidth/6; } if (document.layers) { for (i=0; i < amount; i++) document.layers['n'+i].document.images['nsi'].src=Cupid.src } else if (document.all) { for (i=0; i < amount; i++) { document.all.msieBats[i].src=Cupid.src //alert('start in if6'); } } else if (ns6) { for (i=0; i < amount; i++) document.getElementById("ns6Bats"+i).src=Cupid.src } function dismisscupid() { clearInte</x-turndown>

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups