HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
magnify image
Post new topic   Reply to topic    HTML Help Forum -> General HTML
View previous topic :: View next topic  
Author Message
sher_amf



Joined: 19 Dec 2007
Posts: 18

PostPosted: Wed Dec 26, 2007 4:11 am     magnify image Reply with quote

how is it to magnify image when the mouse is over the image? exactly like this...
http://www.cssplay.co.uk/menu/magnify.html
sticks464



Joined: 31 Dec 2006
Posts: 2624

PostPosted: Wed Dec 26, 2007 5:09 am     Reply with quote

Use 'View', 'Source'. The css is is in the head section and the html is the 'menu' div.
sher_amf



Joined: 19 Dec 2007
Posts: 18

PostPosted: Thu Dec 27, 2007 9:20 pm     Reply with quote

so how is it done? i dont understand the codes too long
ogsolution



Joined: 26 Dec 2007
Posts: 144

PostPosted: Thu Dec 27, 2007 11:03 pm     Reply with quote

These are the lines you should look at from that site's source.
------------------------------------------------
<style type="text/css">
#menu a.p1:hover {text-decoration:none; background-color:#8c97a3; color:#000;}
#menu a .large {display:block; position:absolute; width:0; height:0; border:0; top:0; left:0;}
#menu a.p1:hover .large {display:block; position:absolute; top:-65px; left:150px; width:300px; height:300px; border:10px solid #ccc;}
</style>

<div id="menu">
<a class="p1" href="#nogo" title="thumbnail image"><img src="../img/tdrips.jpg" title="Thumbnail image" alt="Thumbnail image" /><img class="large" src="../img/drips.jpg" title="Enlarged view of image" alt="Enlarged view of image" /></a>
</div>
------------------------------------------------
The trick is the hover command in CSS. The large image is initially set to 0 width and 0 height. When you mouseover the small image, it will trigger the last CSS rule that sets the large image to 300px width and 300px height. That's how you can see the large image when you mouseover the small image.
sher_amf



Joined: 19 Dec 2007
Posts: 18

PostPosted: Sat Dec 29, 2007 5:28 pm     Reply with quote

wait i dont know how to use css only html..
ogsolution



Joined: 26 Dec 2007
Posts: 144

PostPosted: Sat Dec 29, 2007 8:25 pm     Reply with quote

Hope this is clear enough. You just need to prepare a small image and a big image.

Code:
<html>
<head>
   <style type="text/css">
   #menu a.p1:hover {text-decoration:none; background-color:#8c97a3; color:#000;}
   #menu a .large {display:block; position:absolute; width:0; height:0; border:0; top:0; left:0;}
   #menu a.p1:hover .large {display:block; position:absolute; top:-65px; left:150px; width:300px; height:300px; border:10px solid #ccc;}
   </style>
</head>
<body>
<div id="menu">
<a class="p1" href="#nogo" title="thumbnail image"><img src="../img/tdrips.jpg" title="Thumbnail image" alt="Thumbnail image" /><img class="large" src="../img/drips.jpg" title="Enlarged view of image" alt="Enlarged view of image" /></a>
</div>
</body>
</html>
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> General HTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial