I have been trying to find a solution to the flash of no content I get when loading a :hover background image in a menu.
My requirement is that the text area be fluid in width, and the tabs have rounded ends. This means that I must use two background images (a left and a right)
I have tried two methods:
Method A)
I created two images, each with an Off, On, and Selected image section. Thus no preloading is needed. The idea was to position them differently for each section to show. This works great for the left image, since I position them ??px from the left. But the right end image has an undetermined (fluid) area to fill, and so it must be positioned from the RIGHT. But I don't think there is a way to do that. (I can set it to "right", but that only works for the right most of the three sections.)
Does anyone know of a way to position a background image, via CSS, referencing the RIGHT side of the element?
I know that I could easily solve this if the right side of my tabs were square, OR if the element width was fixed and equal. But neither of those are my case.
Method B)
Use three images. The Off and Selected load and display, then on "hover", the On image replaces the Off. I have tried many methods (putting them in their own <div>, cascading them in one <div>, cascading them ahead of the Off image in the actual <a>, tried no display, position -1000px, etc., etc.). None of them actually work. If you reload the page, refreshing images (Ctrl+F5) or delete cache and reload, you get a slight loading flash. This is true in IE (6, 7) as well as FF (3.5).
Here's an example that is supposedly doing this:
http://divitodesign.com/dd-articles/...der/index.html
But it fails just as my attempts do.
I have read somewhere that this CSS "preloading" actually doesn't cache the images, because the DOM has not started to build yet. Can anyone confirm that?
I have also tried loading them as actual backgrounds on the same page, so I could SEE the :hover image already loaded on the page, but... on the first load and hover, the menu tab goes blank, and then loads. EVEN THOUGH the image is visible on the page. Really no different than the link I posted above...
Can ANYone explain what the deal is?
Thanks, Pete