|
-
May 6th, 2002, 10:29 PM
#1
Thread Starter
Hyperactive Member
Hide Image until mouseover?
Is this possible to do? I tried almost everything I could think of but I can't make it so when the page loads a specific picture doesnt show until I move my mouse over it...
any help would be appreciated!
-Emo
-=VB6 Enterprise Edition=-
-=VC++6Enterprise Edition=-
«¤E³m°O²™¤»
-
May 7th, 2002, 03:55 AM
#2
Fanatic Member
Try putting it inside a layer. I'd use this code to acheive it
Code:
<div style="position:absolute; left:20px; top:50px; width:100px; height:100px;" onmouseover="document.getElementById('image1').style.visibility='visible'">
<img id="image1" name="image1" src="image1.jpg" style="visibility:hidden;">
</div>
-
May 7th, 2002, 05:46 AM
#3
Frenzied Member
And I think also you can use display rather than visiblity:
Code:
<div style="position:absolute; left:20px; top:50px; width:100px; height:100px;" onmouseover="document.getElementById('image1').style.display='block'">
<img id="image1" name="image1" src="image1.jpg" style="display:none;">
</div>
You can also use "inline" rather than "block" if you want the image to stay in the "flow" of the rest of the document.
-
May 7th, 2002, 05:52 AM
#4
Fanatic Member
You can also use "inline" rather than "block"
Yeah, but by default Div is set to block as it is a Block Element. If using inline wouldn't it be better to use Span?
-
May 7th, 2002, 06:05 AM
#5
-
May 7th, 2002, 09:03 AM
#6
Frenzied Member
I could be wrong about this, but, if you use "display: none", then how will you me able to mouse over it? I sugest "visibility".
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 7th, 2002, 10:44 AM
#7
Black Cat
Travis hit the nail on the head.
You could also use a transparent gif at first, and just do a normal image swap at mouseover.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|