JQuery idTabs plugin parameters

I am using jQuery idTabs plugin. I want to provide a link to link (href) function and use the default parameters with that function. How can I do?

<ul class="idTabs"> 
 <li>
      <a href="#div_1" href="google.com">
      Hover call div_1 and Click Call go to google
      </a>
 </li> 
</ul>

      

Note: I am using the hover> $ ("...") function . idTabs ("! mouseover"); and I have used this menu system .

Best wishes.

0


a source to share


1 answer


Here you can bypass this plugin limitation so that when you hover over it you see the content of the DIV and when you click you go to the URL.

In the html add a custom attribute named "url" as follows:

<ul class="idTabs"> 
 <li>
      <a href="#div_1" url="http://www.google.com">
        Hover call div_1 and Click Call go to google
      </a>
 </li> 
</ul>
<div id="div_1">Contents of Div1</div>

      



In your jQuery script add the following:

$(function(){
 $(".idTabs").idTabs("!mouseover");
 $(".idTabs a").click(function(){
   var url = $(this).attr('url');
   if(url){
     window.location = url;
   }
 });
});

      

+2


a source







All Articles