Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

show hide script

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I'm wanting to code a "mouseover" type script that when the mouse goes over a specific "spot"..say an image or a thumbnail or even a number. In a totatally different section on the page the referred image appears. I think I've explained that right.

I've seen on some sites that do this, have in the script "showhide" im not sure if that is what this trick is called, but I would appreciate a code for this. thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is done with layers.....
here is the basic code
<html>
<head>
<script>

function ShowIt(how,wlayer){
if (document.getElementById) {
document.getElementById(wlayer).style.visibility = how;
}
else if (document.all) {
document.all[wlayer].style.visibility = how;
}
else if (document.layers) {
document.layers[wlayer].visibility = how;
}
}
</script>
<title>A1ien51's DHTML Advert</title>
</head>
<div id="ADVERT" style="position: absolute; z-index: 5; top:100; left:100; width:100; height:100; background:#ffff00; visibility:hidden">
<p>This is the layers text</p>
</div>
<div id="TheText" style="position: absolute; z-index: 5; top:400; left:100; width:100; height:100; background:#ffff00; visibility:hidden">
<p>Smile, The code is easy to play with</p>
</div>
<a href="http://www10.brinkster.com/A1ien51" onmouse_over="ShowIt('visible','ADVERT')" onmouse_out="ShowIt('hidden','ADVERT')">Mouse Over Me Please</a>
<a href="http://www10.brinkster.com/A1ien51" onmouse_over="ShowIt('visible','TheText')" onmouse_out="ShowIt('hidden','TheText')">Mouse Over Me Please</a>
</html>
make sure to take thelines out of the mouse_over and mouse_out
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic