/*! * Leftbar open/close */ $(function() { $('a[href^="index.php%3Fp="]').each(function(){ now_url = location.href.split('p=')[1]; target_url = this.href.split('p=')[1]; if(now_url == target_url){ $(this).parent('li').parent('ul').prev().click(); } }); });