User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 428,468 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,160 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting

Smaller image to larger Image on rollover

Join Date: Jan 2008
Posts: 37
Reputation: robothy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
robothy robothy is offline Offline
Light Poster

Re: Smaller image to larger Image on rollover

  #7  
May 7th, 2008
Hi,

One option, which I have used in a different manner is to have a separate div display on hover.
The HTML for it would be something like this:
<a class="enlarge_picture" href="#" title="Picture Name">
	<img class="normal_picture" src="./the/path/to/your/image.png" alt="Image Name" height="60" width="140"><div class="hover_enlarge"><img class="large_picture" src="./the/path/to/your/bigger_image.png" alt="Image Name" height="120" width="280"></div>
</a>

Then if you were to apply some CSS styles like the following:
.enlarge_picture {
	margin: 0px; padding: 0px; border: none;
	text-decoration: none;
}

.normal_picture .hover_enlarge {
	display: none;
}

.normal_picture:hover > .hover_enlarge {
	position: relative; top: -100px; left: 100px;
	display: block;
	height: 173px; width: 213px;
	margin: 0px; padding: 0px; border: none;
}

For a good example of this, go to istockphoto.com, as they do exactly the same as you're asking.

And I the styles above will almost certainly need tweaking, as I've not tested them.

Best,
R.
Reply With Quote  
All times are GMT -4. The time now is 9:13 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC