Closed (fixed)
Project:
Textimage
Version:
5.x-1.2
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2007 at 03:17 UTC
Updated:
6 Feb 2009 at 05:04 UTC
Imagine you have Textimage headings on your site which are also links. It would be nice to automatically generate a 'hover' version of the image, for example with a different colored font, and save it in the same directory as the original .png or .gif but with an extra term like "rollover" infront of the extension. Then using a bit of jquery we could watch for any mouseovered heading links, and switch the src to the version with 'rollover' added in the filename.
Comments
Comment #1
danielb commentedupdate: I have successfully done rollover menu links with textimage
I don't particularly remember how, but here is the code I put in menu-item.tpl.php which can give you clues to how I did it
also this css (don't use visibility:hidden; the hover flickers)
possibly this too if it messes up in ie6
and something like this if you're using PNG
Comment #2
danielb commentedJust be careful using this with the sitemap module - you might need to print out two lots of links - one for the menu and one for the sitemap, and then use css to hide the wrong one, or use php to determine whether you're in the sitemap or not (but I don't know how to do that.. perhaps check the query string).
Comment #3
attiks commentedFYI, a solutions using jQuery
How-To:
1/ create 2 presets: menulinks and menulinksover
2/ add the code below to page.tpl.php
3/ sit back and relax :p
Peter
Attiks - graphic design and web applications
Comment #4
decipheredThe ability to create rollovers with Textimages is something to be achieved at the theme level using one of many methods, some listed here, some not (including my option, two create a sprite using two textimage presets and do the rollover with a css background position).
While this is not a feature request, and is being closed, it may be prudent to add some documentation outlining how users can achieve rollovers with Textimage in the future.
Comment #5
danielb commentedI have been doing this using my module Textimage Autoinsert - it needs a bit of work (and isn't available for D6 yet) as I've come across bugs on almost every complex use-case I try to use it for - but I'm slowly working through it.
But basically my module allows you to apply a textimage preset to a certain HTML element e.g: all H3 tags with the class 'title', or all 'a' tag with the class 'menu-item', and then another preset for all 'a' tags with the class 'active' - as well as choosing how to do this - whether textimage replaces the text, is a background to the text, or is appended to the text. And all of this is done straight from the Textimage settings page - no PHP code or themes necessary (except to install it in the first place)
Still need your own CSS though, to either make something transparent that is over the top of something else, or to slide a background position around, etc.. your choice. Perhaps when I find time to really crack down on making this an easily usable module I will add a feature to automate this.
Comment #6
deciphered@danielb
The module sounds great, will check it out when I get a few minutes.