CSS - Table Rollover Image Not Preloading
Hi, my rollover image for my table does not work. It does not seem to preload the images as expected, so the rollover effect does not look good. There seems to be some type of a lag when I rollover. I don't understand why? Below is the code. It can also be found at http://members.lycos.co.uk/eflix/junk.html
Code: <html> <head> <SCRIPT language="JavaScript"> if (document.images){ var preloadPic1 = new Image(); preloadPic1.src = 'http://members.lycos.co.uk/eflix/TBOFF.gif'; var preloadPic2 = new Image(); preloadPic2.src = 'http://members.lycos.co.uk/eflix/TBON.gif;'; } </SCRIPT> <STYLE> .topbar {background-image:url('http://members.lycos.co.uk/eflix/TBOFF.gif'); } .topbar2 {background-image:url('http://members.lycos.co.uk/eflix/TBON.gif;');} </STYLE> </head> <body> <br><br><br><br><br><br><br> <table cellspacing=0 cellpadding=0 border=0 width=770> <tr><td> <table cellspacing=0 cellpadding=0 width=770 border=1 bordercolor=#6DBEE8 style="border-collapse: collapse; border-width: 1px;"> <tr height=20> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">A</a> </td> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">B</a> </td> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">C</a> </td> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">D</a> </td> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">E</a> </td> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">F</a> </td> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">G</a> </td> <td class="topbar" align=center onMouseOver="className='topbar2'" onMouseOut="className='topbar'"> <a class="topbarlink" href="">H</a> </td> </tr> </table> </td></tr> </table> </body> </html> Similar TutorialsHey, I have a problem with IE and my CSS. I have a table with a background-image and I wan that to change to a certain color on rollover. div.special {background-image: url(../images/pinkfade_bg.gif);} div.special:hover { background:#F8F8F8; } div.normal { background:#FFFFFF; } div.normal:hover { background:#F8F8F8; } Now this works fine in Mozilla, Safari etc. Just not IE Any ideas? Hi, anyone an idea how to change both text color AND table cell bgcolor on rollover (using style sheets) ? thx Gerhard how do i have images rollover? ie when the mouse i NOT on the image its img1 and when mouse is its img2?? i cant work that out cheers actually i have sort of done it but with some problems: Code: a:link, a:visited { background: url('images/offlinks/contactus.jpg'); } a:hover { background: url('images/onlinks/contactus.jpg'); } </style> </head> <body> <a href="whatever"> hello </a> it works if i put any text where hello is! but thenthat background has text so it makes it unreadable? Code: .contact a:link, .contact a:visited { background-image: url('images/offlinks/contactus.jpg'); text-decoration:none; color:#CED3DB; font-size:25px; } .contact a:hover { background-image: url('images/onlinks/contactus.jpg'); } in the book doing this would make the links in contact class have that image but it doesnt work? I am currently trying to figure out how to make a webpage with a navigation bar that consists of rollover images, BUT if the site has CSS and/or images disabled for a visually impaired user, text will appear as links. I have been searching the net, but have had no success in a solution other than not using images. HTML for Navigation Code: <!--NAVIGATION--> <ul> <li id="home"><a href="index.html"></a></li> <li id="students"><a href="students.html"></a></li> <li id="faculty"><a href="faculty.html"></a></li> <li id="facilities"><a href="facilities.html"></a></li> <li id="maps"><a href="maps.html"></a></li> </ul> CSS for first Button Code: /*--NAVIGATION--*/ ul{ margin: 0; padding: 0; list-style: none; } li#home{ background-image: url(images/nav_home.png); width: 205px; height: 52px; display: block; } li#home a{ background-image: url(images/nav_home.png); background-position: 0 0; height: 52px; width: 205px; display: block; } li#home a:hover{ background-image: url(images/nav_home.png); background-position: 204px 0; } I am trying to implement the below code for my own page. The issue for me is I don't know how to get the background image to overlay the link text. Unlike in the example I don't want the text links on top of the image, I would like to be behind. Is this possible? Live demo of example: http://www.tutorio.com/media/css-tutorials/rollover-example.htm Code: <div class="rollover"> <a href="#">Item 1</a> <a href="#">Item 2</a> <a href="#">Item 3</a> <a href="#">Tutorio</a> </div> Code: .rollover a { display:block; width: 90px; padding:10px 10px 10px 7px; font: bold 13px sans-serif;; color:#333; background: url("rollover-image.gif") 0 0 no-repeat; text-decoration: none; } .rollover a:hover { background-position: 0 -35px; color: #049; } .rollover a:active { background-position: 0 -70px; color:#fff; } I've tried adding an image between the <a and </a> and tried to change that when hovered. Code: <a href="about.htm"><img src="images/testimage.png" alt="" class="testimage"/></a> Code: a.img.testimage:hover { background-position: 0 -40px; } OK, I've gotten this to work a hundred times before, but today I am stumped. Basically, I am trying to create an image rollover with CSS. here is my CSS: Code: a.footer_box3{ width:222px; height:169px; background-image:url('images/footer/footer_test/footer_box3_off.png') no-repeat; border:none; display:block; } a.footer_box3:hover{ width:222px; height:169px; background-image:url('images/footer/footer_test/footer_box3_on.png') no-repeat; border:none; display:block; } the above CSS is in the header of the document. Here's the code for the rollover in the page: Code: <td background="images/footer/footer_test/footer_box3_off.png" width="222" height="169"> <a href="our_people.asp" class="footer_box3"></a> </td> You can see the site here Scroll down to the bottom of the page where there are 4 footer boxes. I am only trying to get the third box to swap images on hover. can anyone see what I am doing wrong? thanks I've noticed that now that I separate markup and presentation that my CSS files are significantly larger. For instance just one of my pages worth of presentation declarations is 300 lines long. Given an extremely large site, do you think you'd ever have to get to the point where you'd preload the CSS file? -B I have these thumbnail images that I want to have a thin border around them when you rolloever. A thin gray border that isn't tight to the image, but has a bit of padding. I have other link styles, so I'm naming this "a.thumbs" it seems right, but I can't get it to work. I'm not sure whether to put a border on the image...set it at 1 or 0, I've tried both....and I still can't get the style to work. At one point, it worked, but all it was doing was picking up my link style. What's the problem with the code....or what is the best way to achieve this kind of rollover? Thanks. a.thumbs:link{ padding: 5px 15px; border: 1px solid #FFFFFF; } a.thumbs:visited{ padding: 5px 15px; border: 1px solid #CCCCCC; } a.thumbs:hover{ padding: 5px 15px; border: 1px solid #CCCCCC; } OK, I've made this work in the past with no problem, but for some reason, I can't figure out this simple snippet of css for a navigation rollover with an image. Here's my code: Code: a.creative_development{ width:289px; height:28px; background-image:url('../images/services_titles/creative_title.gif'); } a.creative_development:hover{ width:289px; height:28px; background-image:url('../images/services_titles/creative_title_on.gif'); } I've checked the paths, folder name, and image names, but it's not working. Can someone see what I'm doing wrong? thanks I developed a site years ago using JavaScript for a roll-over function. Now the client is having issues with customers not being able to use the roll-over function because they have Java Script disabled. Is it possible to do this using css? For an example, see this page: chellatextiles.com/Textfab/cocotweed.html Rollover a color thumbnail and it replaces the fabric details. There are about 500 thumbnails through the site that I would need to change. Does anyone have have an idea of why the problem I am about to describe is happening? View this link in IE 6: paintingshiva.com / 2006rd / www / template / gallery.html can't post url.. take out spaces between slashes URL This site is a prototype for my website that I am redesigning. The page above will be one of the gallery pages. Right now, I ma using colored circles as placeholder content. Rollover the right side ART navigational elements (colored circles). The weird circumstance: When I rollover, two different nav elements one after another (except for the first one), the div where the title elements are, fold up into the main content area (where the large colored circle is). But if you rollover the first one after this happens, everything goes back to normal. I can not figure out why this is happening. I built the ART navigational elements by adding a background image to the style of the anchor tags. There is also a JavaScript at the top of the page that is changing the style of each element to make the rollover effect. I'm running into a problem with IE and using the :hover sub-class on an image within a class. IE: .zoomer img:hover {}. Works just fine, nice and neat in any other browser. Page in question: [URL=http://www.cavemanapparel.com/ncaa-c-34.html[/URL] Code: .zoomer img:hover { background: #008; margin-left: auto; margin-top: -400px; position: absolute; z-index: 999; display: block; border: 0; height: 60%; width: 40%; overflow: visible; clear:both; } I've tried placing various hacks and/or solutions I've found across the web inside: <!--[if IE]> <![EndIf]--> but the POSITION attribute seems to be ignored and takes on the code in the .css file. I know WHY it's doing it but can't seem to fix it. Well, I guess if I knew exactly why it's doing it I would be able to fix it. Right? Anyway, if you view the page source, I'm sorry for the shoddy work. It's been a long couple of days. Any insight or solutions are greatly appreciated. Hi all, Wondering if anyone knows a tweak to make the following work in IE7 using pure CSS? I have an image that grows when it is rolledover. Css simply as follows: .graph { width: 200px; height: 50px; } .graph:hover { width: 600px; height: 150px; } Works fine in FF (as usual!) Regards Charlie Hello CSS Readers & Experts, I have a very common problem that Ive done some searches on, but yet to find the solution. My Image Rollover flickers. You can view this problem at www.clickcolumbia.com/onlinecommunity im guessing it has somethin to do with my css, heres the code a.mainlevel:link, a.mainlevel:visited { display: block; background: url(../images/menu_bg.png) no-repeat; vertical-align: middle; font-size: 11px; font-weight: bold; color: #ffffff; text-align: left; padding-top: 5px; padding-left: 18px; height: 20px !important; height: 25px; width: 100%; text-decoration: none; } a.mainlevel:hover { background-position: 0px -25px; text-decoration: none; color: #333333; } Please help Hey peeps, having trouble getting background images to display rollOvers for a <td> tag in IE (pc and mac). Works fine in firefox and safari. Heres me code: CSS: Code: .house_menu_cell { background-image: url(../images/nav/homes/glo_house_nav_bg_0.gif); cursor:pointer; } .house_menu_cell:hover { background-image: url(../images/nav/homes/glo_house_nav_bg_1.gif); cursor:pointer; } HTML: Code: <td class="house_menu_cell"> Any help would be great. Ive spent about an hour trauling the net with no luck! Cheers mish Disregard pot I simply transposed li and a tag thanks anyway... Hi everyone, I have a menu whereby when it's active it is highlighted by two combining images. Whenever the active link is hovered over the image disappears. I'd like for the image(s) to stay put when it's active and the cursor hovers over it. This particular .css file is above my pay grade and I'm not confident I can do this and have it look good across all browsers. Just click on the header links and hover over it to see what I'm talking about. Thanks for any input, here's the site... spotabusiness dot com/new_spota1 (I apparently can't add URLs yet) i ahve seen sites, using one image rollover that has one image one on top of the other... can someone give me a clue on the syntax thanks Hi, I'm developing a childrens story website, and ran into a problem with the layout in Firefox. Everything worked perfectly on my local server, but after I uploaded it to my hosting account I came across a strange problem. When I first go to the homepage everything looks, and works, fine. And if I refresh the page a few times, it still all looks fine. But if I click on the "Home" link a few times the whole layout breaks on every 3rd or 4th click of the home button. You can see the design at http://develDOTstephenhmDOTcom/bedtime/index.php. (Sorry for the link, but it's my first post and I can't add urls yet) This problem doesn't exist in IE7, just Firefox as far as I can tell. I know the rest of the sites layout is a bit messed up in IE7 at the moment, as I haven't gotten around to adding the IE7 only css info yet. I'm sure it's a stupid error on my part, but I was hoping somebody could point me in the right direction. Thanks a lot in advance to anyone who can help. For the image rollovers the basic html for each one is: <a class="happylarry" href="happylarry.php"> <div class="image_text"> Happy is an Irish Leprechaun who lives in the left-hand pocket of your child.<br /><br />And of course his real name is not 'Happy'. His real name is 'Larry'. But Larry Leprechaun is such a happy little fellow, and he gets up to so much mischief, that all of his friends and family call him 'Happy Larry'. </div> </a> and the relevant css is: a.happylarry { display: block; float: left; min-width: 222px; width: auto!important; width: 222px; height: 524px; background: url('images/happylarry.png') no-repeat 0 0; text-align: center; margin-right:13px; text-decoration:none; } a.happylarry:hover { background-position: 0px -524px; } .image_text{ color:#FFFFFF; max-width:180px; margin-left:25px; *margin-left:0px; margin-top:250px; text-align:left; font-size:12px; font-family: Arial, Helvetica, sans-serif; } |