JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 4th, 2008, 02:08 PM
echoskybound echoskybound is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 5 echoskybound User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 20 sec
Reputation Power: 0
Unhappy REALLY need help: Making hidden div appear when an image is hovered/clicked

I need to be able to make a hidden div appear when an image is hovered over or clicked on. I have no idea how to go about doing this. I've used codes for making images appear when something is hovered over, but I don't know if it's the same for an entire div. Is it possible to make a seperate html file for the object that needs to appear (instead of making it a hidden div), and include it the same way as an image?

I really need help :[ If anyone has any suggestions or resources, I'll appreciate it a lot (I'll draw you a picture of your dog or something!)

Reply With Quote
  #2  
Old May 4th, 2008, 05:14 PM
atlantisstorm atlantisstorm is offline
Hang your freedom higher.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 10 h 14 m 2 sec
Reputation Power: 113
You just need to use the display style setting - set to 'none' (to hide) or 'block' (to show) as appropriate.

Here is a basic example using onClick assigned to a span element, obviously this can be an img or anyother element that supports onClick event.

Code:
...
<script>
function showHide(id)
{
	var current_state = document.getElementById(id).style.display;
	if(current_state == "block")
	{
		document.getElementById(id).style.display = 'none';
	}
	else		
	{
		document.getElementById(id).style.display = 'block';
	}
}
</script>

<span onClick="showHide('show')" >Show/Hide</span>
<div id="show" style="display:none;">
	Can you see me!?
</div>
...
__________________
"Badges? We ain't got no badges. We don't need to badges! I don't have to show you any stinkin' badges!!"

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > REALLY need help: Making hidden div appear when an image is hovered/clicked


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway