Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-25-2007, 03:29 PM   PM User | #1
greens85
Regular Coder

 
Join Date: Sep 2007
Posts: 809
Thanks: 5
Thanked 2 Times in 2 Posts
greens85 is an unknown quantity at this point
Question Image Viewer

Hi All,

I know this is a simple problem because ive done it before, but i just cant remember how i did it

What i want to do is create an image viewer, i have a number of thumbnails and a large div tag that is blank, when the user rollsover the thumbnail the large image is display in the blank div, but whats happening is the large image is displaying in the thumbnail div.

This is what i have:

Thumbnail Div:

Code:
<div id="ptmimage1"><a href="#"><img src="../../Images/shim.gif" width="59" height="88" border="0" /></a></div>
Large Div:

Code:
<div id="ptmlargeimg"></div>
Then the CSS is set like this:

Code:
#ptmimage1{
	position:absolute;
	background:url(Images/ptm1.jpg) no-repeat top left;
	width: 59px;
	height: 88px;
	left: 17px;
	top: 102px;
}

#ptmimage1 a:hover{
	background:url(Images/ptm1_large.jpg) no-repeat top left;
	width: 206px;
	height: 309px;
}
Can anyone help me jog my memory on this one?

Thanks
greens85 is offline   Reply With Quote
Old 10-25-2007, 03:46 PM   PM User | #2
greens85
Regular Coder

 
Join Date: Sep 2007
Posts: 809
Thanks: 5
Thanked 2 Times in 2 Posts
greens85 is an unknown quantity at this point
I've remembered now, for anyone who might have the same problem... I forgot to give the rollover div tag the:

position:absolute;

element
greens85 is offline   Reply With Quote
Old 10-25-2007, 04:52 PM   PM User | #3
jcdevelopment
Senior Coder

 
jcdevelopment's Avatar
 
Join Date: Oct 2007
Location: Cowboy Nation
Posts: 2,171
Thanks: 173
Thanked 257 Times in 257 Posts
jcdevelopment will become famous soon enoughjcdevelopment will become famous soon enough
you could also use the visible element and just call it when rolled over, of course that may be way too much code..
jcdevelopment is offline   Reply With Quote
Old 10-26-2007, 10:56 AM   PM User | #4
greens85
Regular Coder

 
Join Date: Sep 2007
Posts: 809
Thanks: 5
Thanked 2 Times in 2 Posts
greens85 is an unknown quantity at this point
Ive got it working now, but there is still a problem, because i have it working as a rollover. If the user rollovers over but then moves the mouse in the slightest (even within the thumb bounds) the picture disapears or flickers on an off.

If there away round this, is there a way i could make the feature onclick or something, but without the onclick loading a new page??

thanks
greens85 is offline   Reply With Quote
Old 10-26-2007, 06:23 PM   PM User | #5
Actinia
Regular Coder

 
Actinia's Avatar
 
Join Date: Feb 2007
Location: Essex, UK
Posts: 250
Thanks: 1
Thanked 23 Times in 22 Posts
Actinia is on a distinguished road
You could try removing the onmouseout from the thumbnail and putting an onclick into the big picture div. I use something similar a lot, except that I have a 'close' button at the bottom of the picture div which closed the div when clicked.

John Rostron
Actinia is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:26 AM.


Advertisement
Log in to turn off these ads.