Jquery accordion change link function after second click -


i've got simple accordion, , wondering how change link after second click goes actual url. first click opens accordion, working fine, second click goes href.

my accordion code is

$(".mobile-main-nav ul ul").accordion({             collapsible: true,             active: false,             header: "a.level2"         }); 

i know event:false option disable click event, unsure best method apply it.

thanks in advance!

you can hook 'beforeactivate' event of accordion attach flag attribute element. run through conditional , should close want.

$("ul.testnav").accordion({ collapsible: true, active: false, beforeactivate: function(e, ui){     if(ui.newheader.attr('data-visited')){         window.location = ui.newheader.attr('href');     } else {          ui.newheader.attr('data-visited', 'true');     } } 

});

http://jsfiddle.net/p6jef/1/ (the actual linking won't work jsfiddle doesn't have 'page1.html')


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -