Jump to content

loop0007

New Members
  • Posts

    2
  • Joined

  • Last visited

loop0007's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. my mistake i am sorry ! sorry i didnt't explaind much this code let node/categories of xenforo to collapse and expand but on reload of page they didn't remain collapsed. its collapse and expand function is working but cookie function is not working so i need help for this code to work i can make a live setup if anyone is interested in testing, For Reference : https://xenforo.com/community/threads/dont-work-after-reload-script-js.77211/
  2. well i am not a javascript expert or coder i need help to update this javascript so that it works properly with no errors <script type="text/javascript"> <!-- $('.categoryNodeInfo').prepend("<div class='showhideNodes hideNodes'>Collapse</div>"); var showhideNodesCookie = $.getCookie('showhideNodes'); var showhideNodesArray=new Array(); if (showhideNodesCookie) { showhideNodesArray = showhideNodesCookie.split(","); $.each(showhideNodesArray,function(){ var selector = 'li[id='+this+']'; $(selector+' ol.nodeList').hide(); $(selector+' .showhideNodes').toggleClass('showNodes'); $(selector+' .showhideNodes').toggleClass('hideNodes'); $(selector+' .showhideNodes').text('showhideNodes_expand'); }); } $('.showhideNodes').click( function() { if ($(this).text() == 'Collapse') { $(this).parent().next().slideUp(); $(this).text('showhideNodes_expand'); //if($.inArray(this,showhideNodesArray) != -1){ showhideNodesArray.push($(this).parent().parent().attr('id')); $.setCookie('showhideNodes',showhideNodesArray.join(",")); //} } else if ($(this).text() == 'showhideNodes_expand') { $(this).parent().next().slideDown(); $(this).text('Collapse'); var remove = $(this).parent().parent().attr('id'); showhideNodesArray.splice($.inArray(remove,showhideNodesArray),1); $.setCookie('showhideNodes',showhideNodesArray.join(",")); } $(this).toggleClass('showNodes'); $(this).toggleClass('hideNodes'); }); //--> </script> well i hope someone can update it with its same functioning thanks and sorry for my bad english
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.