Aca esta el codigo que arma el acordeón:
<script type="text/javascript" src="/components/com_community/assets/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
<!--
// this tells jquery to run the function below once the DOM is read
$(document).ready(function() {
// choose text for the show/hide link
var showText="Ver Todos";
var hideText="Ocultar Todos";
// append show/hide links to the element directly preceding the element with a class of "toggle"
$(".toggle").prev().append(' (<a href="#" class="toggleLink">'+showText+'</a>)');
// hide all of the elements with a class of 'toggle'
$('.toggle').hide();
// capture clicks on the toggle links
$('a.toggleLink').click(function() {
// change the link depending on whether the element is shown or hidden
if ($(this).html()==showText) {
$(this).html(hideText);
}
else {
$(this).html(showText);
}
// toggle the display
$(this).parent().next('.toggle').toggle('slow');
// return false so any link destination is not followed
return false;
});
});
//-->
</script>
Yo lo unico que hago es envolver el foreach que trae los comentarios con <div class="toggle">
Aca esta el codigo de los links que filtran:
<div id="activity-stream-nav" class="filterlink">
<div style="float: right;">
<a class="active-profile-and-friends-activity active-state" href="javascript:void(0);"><?php echo JText::sprintf('CC PROFILE OWNER AND FRIENDS' , $profileOwnerName );?></a>
<a class="active-profile-activity" href="javascript:void(0);"><?php echo $profileOwnerName ?></a>
</div>
<div class="loading"></div>
</div>
Y aca está el Jquery que lo activa:
jQuery('.active-profile-and-friends-activity').bind('click', function() {
if ( !jQuery(this).hasClass('active-state') ) {
loading( jQuery(this).attr('class') );
jax.call('community', 'frontpage,ajaxGetActivities', 'active-profile-and-friends');
}
});
jQuery('.active-profile-activity').bind('click', function() {
if ( !jQuery(this).hasClass('active-state') ) {
loading( jQuery(this).attr('class') );
jax.call('community', 'frontpage,ajaxGetActivities', 'active-profile');
}
});
No soy programador, pero imagino que el problema es el domready no?
Hay una forma de resolver esto? Espero que me ayuden
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Muchas gracias!