JQuery Accordion with buttons - How to prevent opening?
I've been playing around with the Accordion in the JQuery UI library. I've created some headers and I added some buttons to them开发者_JS百科. Now I would like to be able to click the buttons without opening that section.
My buttons are in fact ASP.Net buttons that generate scripts with onclick="some scripting"
. This scripts still needs to be executed. Any ideas?
If they're nested you could catch this click event before it's bubbling up to parent elements by using
$('#buttonid').click(function(e){
e.stopPropagation();
//Your Code here(For example a call to your function)
});
You shouldn't use onClick in the markup, if you're working with a JS Framework anyways
精彩评论