By redraven on
Hi
I have been playing round with tab menus, specifically the slidingdoors technique.
http://www.alistapart.com/articles/slidingdoors2/
Everything is working fine, except when dealing with cross-browser compatiblility, IE of course!
I need to figure out how to embed a span element within the anchor element of a primary link.
Does anyone have any ideas on how to accomplish this.
I am using the menu module in 4.7 to manage the primary links.
Thanks for any advice.
Comments
DOM script
One option would be to use javascript to manipulate the primary links structure after it has been delivered to the client browser. I can't figure out how to post javascript snippets in these fora. See this issue for the file attachment. I'm using this code on my own site.
checkout my theme
I contributed fancy theme in which i integrated sliding door technique and works with all the browsers.
Sunny
www.gleez.com | www.sandeepone.com
needed for rollovers
Thanks for repies,
I would prefer to avoid javascript, but if need be will resort to it.
I should have mentioned that I am implementing sliding doors technique with single image roll overs.
Here is a snip from the sliding door listapart.com article that applies to my problem.
"IE only applies the :hover pseudo class to anchor elements, nothing else. In order to change both images of the Sliding Doors technique, we would need to insert an additional element (such as a span) inside the anchor, and shift all our style rules one element inward (list item rules shift to the anchor, anchor rules shift to the span)."
Solution
Add the following code to your template.php-file:
Works in my case...
Same issue - Drupal 5
Same exact problem in Drupal 5. The posted functions to add to template.php don't seem to work with Drupal 5. Can someone give a similar solution, but for the latest release?
I've adapted the code above
I've adapted the code above for Drupal 5.1, and it works fine to me.
First of all, create a template.php file in the theme directory.
Then put the following code:
You can see I've changed the l() function in l_span() function in order to provide a span class within the a anchor.
Then I've changed the primary links rendering in order to use l_span() function instead of the classic l() function.
As soon as possible I'll publish the site link where you can find the results.
Hope being useful (and sorry for my bad English), bye!
Ahieving this in Drupal7
How would I do exactly this in Drupal7?