Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
33
rated 0 times [  39] [ 6]  / answers: 1 / hits: 16676  / 11 Years ago, wed, may 15, 2013, 12:00:00

I have a column of buttons that have to do the same thing as the first button but with there own individual pics. How do I set the id so that there's no glitches? Here is what I have so far http://ultimatefinishdetailing.com/Services.html



HTML: (posted HTML BEFORE on the image button)



<STYLE MEDIA=screen TYPE=text/css>
.pop-up {
height: 100px;
width: 100px;
margin-right: -100px;
margin-top: -100px;
position:absolute;
right:-50px;
top:75px;
}
.button {
width:300px;
height:21px;
display:block; background-image:url(images/button_ufad4.jpg);
position:absolute;
}
</style>
<a href= class=button onmouseover=javascript:ShowImage('images/InteriorandExteriorDetailing.jpg') onmouseout=javascript:HideImage()></a>

<div id=popup class=pop-up>
<img id=popupImage alt=Popup image />
</div>


Javascript:



 <script type=text/javascript>
function ShowImage(src)
{
var img = document.getElementById('popupImage');
var div = document.getElementById('popup');
img.src = src;
div.style.display = block;
}
function HideImage()
{
document.getElementById('popup').style.display = none;
}
</script>

More From » html

 Answers
304

Nishant is correct for the mouseout, you are just missing the first single quote.



For the style you would probably want something like this



<style media=screen type=text/css>
.pop-up {
height: 200px;
width: 100px;
margin-right: 100px;
margin-top: -10px;
position:absolute;
right:50px;
top:50px;
}
</style>


The position: absolute; will tell the browser to put it exactly where you want it. In this example I told it to position itself 50px from the top and 50px from the right. You can also use the keywords bottom and left.


[#78217] Tuesday, May 14, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
frederickmohamedw

Total Points: 21
Total Questions: 123
Total Answers: 105

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
frederickmohamedw questions
Wed, Sep 23, 20, 00:00, 4 Years ago
Sat, Jul 18, 20, 00:00, 4 Years ago
Sun, Apr 26, 20, 00:00, 4 Years ago
Sat, Jan 11, 20, 00:00, 4 Years ago
Fri, Dec 27, 19, 00:00, 4 Years ago
;