displaying attachment custom fields
-
You need a bit of javascript to do the follow-the-cursor bit, but you should be able to achieve a static data box with just CSS by using the
:hover
pseudo property. Output the data in a div and style as though it will display all the time as a static or absolute positioned object. When you like the look, adddisplay: none;
to the CSS properties and it’ll disappear.Make a
:hover
selector rule for the anchor link of the image wheredisplay: block;
is one of the properties targeting the data div. Like this:
a#imageID:hover + div#dataID {display: block;}
That should do it! Warning, I’m lousy at CSS, so that example may not be quite right, but it hopefully illustrates the concept of hovering over one thing affecting the display of another.The same effect can be done with javascript using the
onmouseover
andonmouseout
events to toggle thedisplay:
property off and on. If you need more to go on, the same techniques are used all the time for drop down menus. Searching for menu examples will help you, you’re just displaying image data instead of menu terms.BTW, I know the rose is just a test image, but just a reminder, please don’t serve people a 12Mpx image when 0.5 would do!
- The topic ‘displaying attachment custom fields’ is closed to new replies.