dolbysound
Member
Posted 3 years ago #
Hi,
I use jquery tooltip to ad buble info in my link, simply ad class="tooltip" in my href link.
I would like ad a class in my category link (href ! not li)
By défaut, i've :
<ul id="nav">
<li class="..."><a href="#">Logos</a></li>
</ul>
I would like :
<ul id="nav">
<li class="..."><a CLASS="TOOLTIP" href="#">Logos</a></li>
</ul>
How to do it ?
This should work
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("ul#nav a").addClass("tooltip");
});
</script>
You have to load the jQuery library first, by the way...
in header.php in your theme,
put this
<?php wp_enqueue_script('jquery'); ?>
somewhere before this line
<?php wp_head(); ?>
Then put the script after the wp_head() line
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("ul#nav a").addClass("tooltip");
});
</script>
dolbysound
Member
Posted 3 years ago #
Nice on Firefox but doesn't work on IE6-IE7 ?! Why ??
You'll have to check that with whoever made the jQuery tooltip routine
dolbysound
Member
Posted 3 years ago #
yes, jquery version is now update and all is ok ! Thx