|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
Struggling to hover image in right place...
hey all,
I have a listing of products and i have put some CSS code in that displays a bigger version of the image. however, some of the images get cut off on hover... here is the link to see what i mean http://www.wet-bathrooms.co.uk/prod...p?type=c&&id=11 It would be cool if i could plan where it is displayed on teh screen a bt more. Ideally horizontally just to the right of the list and vertically in the middle but my attempts have failed, if i try to set the vertical position then as i scroll down and hover over an image further down it gets displayed at the top because that is where i set it to go!! aaaaaagh anyone see what i mean?? here is the css css Code:
cheers, RF
__________________
|
|
#2
|
||||
|
||||
|
you'll have to use javascript, no pure CSS way. the code is
currently Firefox only (IE won't support hover for tags other than anchor) so JS is must-be. most straight forward way is having placeholder for the bigger image in every row, then use JS to assign the bigger image into the placeholder upon mouse over. |
|
#3
|
||||
|
||||
|
Quote:
|
|
#4
|
||||
|
||||
|
don't understand what you mean.. here is little sample code that
should get you started: (after some thought, I came to understand that simply putting the big images and hide them initially is the best) Code:
<script type="text/javascript">
function ToggleDisplay(strElementID, strNewDisplay) {
var element = document.getElementById(strElementID);
if (!element) {
alert("debug: element with id "+strElementID+" does not exist.");
return false;
}
element.style.display = strNewDisplay;
}
</script>
...
<img src="small.jpg" onmouveover="ToggleDisplay('bigPic1', '');" onmouseout="ToggleDisplay('bigPic1', 'none');" /><img src="big.jpg" id="bigPic1" style="display: none;" />
|
|
#5
|
|||
|
|||
|
Another option is a Javascript Tooltip
http://www.walterzorn.com/tooltip/tooltip_e.htm
__________________
CyberTechHelp |
|
#6
|
||||
|
||||
|
hey guys,
thanks for the suggestions, the tooltip one seems to work ok ish...modified some of the settings a bit. Still if the image is kinda in teh middle of the page sometimes some of it gets cut off ! any thoughts? http://www.wet-bathrooms.co.uk/productListing.php?type=c&&id=11 |
|
#7
|
|||
|
|||
|
Make the image smaller.
Change the position of the tooptip layer. |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Struggling to hover image in right place... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|