it seems that ":hidden" doesn't work or find items..
if i print the content of the cookie everything i get is blank.. the
setCookieState() is called after clicking on the box's ui-icon that
makes the div to "toggle('blind')".
so... when a div it "toggled" it get :hidden tag or not?
however here it is my code
<!-- div structure -->
<div id="b1" class="minimizable"
<h3 class="portlet-header">title</h3>
<div id="portlet-content">
texttexttexttexttexttexttexttexttext
</div
</div>
<script type="text/javascript">
function setCookieState()
{
var s="";
var i=0;
var j=0;
var minimized=new Array();
jQuery(".post-content").filter(":hidden").each(function(){
minimized=jQuery($this).parents("div").find(".minimizable").attr
("id");
i++;
});
// make array from current order
for (i=0; i<minimized.length; i++)
{
if (i==minimized.length-1) s+=minimized[i]+"=1";
else s+=minimized[i]+"=1,";
}
// save custom order to cookie
jQuery.cookie("nextrl_homepage_block_state", s);
document.writeln(s); //--> nothing will be print!!
}
function addButtons()
{
jQuery(".minimizable").find(".portlet-header")
.addClass("ui-widget-header")
.append('<span class="ui-icon ui-icon-plus
ui-switch"></span>')
.end()
.find(".portlet-content");
addEvents();
}
function addEvents()
{
jQuery(".portlet-header .ui-switch").click(function() {
jQuery(this).toggleClass("ui-icon-minus");
jQuery(this).parents(".minimizable").find
(".portlet-content").toggle('blind');
setCookieState();
});
}
jQuery(function() { addButtons(); });
</script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---