Opening custom jquery tab with anchor link

Opening custom jquery tab with anchor link

I really need some help for jquery tabs. I would like to get to a specific tab via external anchor link (http://www.url.com#content2), the navigation link becomes activated and the correct tab is shown.

Other HTML Page

 
  1. <a href = "#b" > B Title </a> | <a href = "#bb" > B Title </a>

HTML Page
  1. <div class = "tabs-container" > <ul class = "tabs" > <li class = "current" ><h4><a href = "javascript:void();" data-tab = "tab1" title = "Title 1" > Title 1 </a></h4></li> <li><h4><a href = "javascript:void();" data-tab = "tab2" title = "Title 2" > Title 2 </a></h4></li> </ul> <div class = "border-box group" > <div id = "tab1" class = "panel group showing" style = " display : block ; " > a </div> <div id = "tab2" class = "panel group" style = " display : none ; " > <a id = "b" > B title A <a><br> information...... <br><br/> <a id = "bb" > B title B <a><br> information...... <br><br/> </div> </div> </div>

Javascript
  1. <script> ( function ( a ){ a . fn . yiw_tabs = function ( b ){ var c ={ tabNav : "ul.tabs" , tabDivs : ".containers" , currentClass : "current" }; b && a . extend ( c , b ); this . each ( function (){ var b = a ( c . tabNav , this ), f = a ( c . tabDivs , this ), e ; f . children ( "div" ). hide (); e = 0 < a ( "li." + c . currentClass + " a" , b ). length ? "#" + a ( "li." + c . currentClass + " a" , b ). data ( "tab" ): "#" + a ( "li:first-child a" , b ). data ( "tab" ); a ( e ). show (). addClass ( "showing" ). trigger ( "yit_tabopened" ); a ( "li:first-child a" , b ). parents ( "li" ). addClass ( c . currentClass ); a ( "a" , b ). click ( function (){ if (! a ( this ). parents ( "li" ). hasClass ( "current" )){ var e = "#" + a ( this ). data ( "tab" ); a ( this ); a ( "li." + c . currentClass , b ). removeClass ( c . currentClass ); a ( this ). parents ( "li" ). addClass ( c . currentClass ); a ( ".showing" , f ). fadeOut ( 200 , function (){ a ( this ). removeClass ( "showing" ). trigger ( "yit_tabclosed" ); a ( e ). fadeIn ( 200 ). addClass ( "showing" ). trigger ( "yit_tabopened" )})} return ! 1 })})}})( jQuery ); </script>

How can i edit? Thank you for your help.