Ok i have a rollover effect that's set to 35 pixels, but then when you click on it it has a 5px space underneath the image. I then made the image 30 pixels and it is now the right height but the image is stretched.
My code is
Code:
<script language="JavaScript" type="text/javascript">
<!--
if (document.images) {
homebuttonup = new Image();
homebuttonup.src = "http://webuycrap.webs.com/NavigationTop/PNG/Homeoff.png" ;
homebuttondown = new Image() ;
homebuttondown.src = "http://webuycrap.webs.com/NavigationTop/PNG/Homeon.png" ;
}
function buttondown( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "down.src" );
}
}
function buttonup ( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "up.src" );
}
}
// -->
</script>
This still doesn't solve the 30 vs 35 pixel problem, but I did not see enough code there to guess as to the nature of the problem. There may be a problem with the original images being different heights, you can stop the stretching by inserting the correct width. If you eliminate tables and used css, then it's not an issue.
Better yet, don't use pictures for the word "Home" use text, and change it's style when hovering. This way the navbar will flow around your customer's browser settings.
I started to use that on my older version of this site, but i kinda driffed away from that. Ill go threw and set a style up for Centering and just use a class and refrence sheet. Thanks
This still doesn't solve the 30 vs 35 pixel problem, but I did not see enough code there to guess as to the nature of the problem. There may be a problem with the original images being different heights, you can stop the stretching by inserting the correct width. If you eliminate tables and used css, then it's not an issue.
Better yet, don't use pictures for the word "Home" use text, and change it's style when hovering. This way the navbar will flow around your customer's browser settings.
--Dave
I tryed to do the whole Id="navbar" thing and set it up with css but it was kinda complicated i thought, I only tryed it once 1 night and i guess if nothing here works i could try that again. And for the Home i have a special text and a border around that text, is there anyway to atleast put a border around it the word? (not a box but around every letter)
Thanks for all the replies
---------------------------------
Ok i just tried your
and it didnt work. Nothing shows up. If i did the using text instead of pictures, how would i make it so when you hover over it it changes a 94 by 35 pixel Dimgray box behind it?
Last edited by hubbajubba; 08-10-2009 at 05:29 PM.
Reason: Tryed the example
* Put img {border:0; margin:0; padding:0} in your style sheet to eliminate any potential border issues.
*You need to quote any name or id's . <td id="home"></td> There can only be one id'd tag on your page as well. There may be multiple names.
* Make sure that both pictures have the same height and width.
* Set both the height and width of the picture. If you don't do this, then the image will be scaled to fit. You can force a 30 by 40 picture into a 20 by 38 frame by putting 'width="20 Height="38"' into your <img> tag, and the image will be horribly distorted, but it will fit.
Bookmarks