there is a hidden div(display:none) and a button to make the div slideTonggle()
in the div is a clistview.
i click the button to make the div toggle to show up, and then i click page 2, then the div automatically toggles to be hidden. Why? How to keep the div show up???
It has been some time that you have posted this and probably you have a solution, but just to help others with similar issues:
Because client side changes are not carried explicitly. You may need to store the status of the div and set it from that variable every time a new page is loaded.
//First add something to save the toggle state every time the state changes. Such as:
<a class="comment-count" onclick="$(this).next().slideToggle();toggleState=$(this).next().is(':visible')">
//then add some javascript function to be called every page load like this
Yii::app()->clientScript->registerScript('script', <<<JS
toggleState=false;
function addJSFunctions(){
...
$(".comment-list").toggle((toggleState)?"visible":"hidden");
}
addJSFunctions();
JS
, CClientScript::POS_READY);