link_to_remote and jquery accordion
Posted
by badnaam
on Stack Overflow
See other posts from Stack Overflow
or by badnaam
Published on 2010-05-28T22:58:16Z
Indexed on
2010/05/28
23:02 UTC
Read the original article
Hit count: 141
jQuery
|ruby-on-rails
I have a standard jquery ui accordion and I load content into it using a link_to_remote tag (in the accordion header). All this works fine. The problem is, once the content is loaded, I dont want a ajax call, I just want the accordion to fold, like it should normally do. I tried doing this using the following jquery but clicking the header hence the link still makes a request.
#lbs_list is the div inside the accordion.
$j('#lnk_show_benefit').bind('click', function(e) {
if ($j('#lbs_list').is(':visible')) {
e.preventDefault();
return false;
} else {
return true;
}
});
© Stack Overflow or respective owner