使用顶部菜单opencart的jquery获取当前类别id

使用顶部菜单opencart的jquery获取当前类别id,opencart,Opencart,单击more链接时,它将重定向到其父类别页面 $('div.sub-menu').each(function(){ var max = 8 if ($(this).find("li").length > max) { $(this).find('li:gt('+max+')').hide(); $(this).find('li:eq('+max+')').after( $('<li class="more

单击
more
链接时,它将重定向到其父类别页面

     $('div.sub-menu').each(function(){
     var max = 8
       if ($(this).find("li").length > max) {
       $(this).find('li:gt('+max+')').hide();
       $(this).find('li:eq('+max+')').after(
         $('<li class="more">More >></li>').click( function(){     
         /*$(this).siblings().show();*/
         /*  $('ul.child').children().show(); */
        /* $(this).remove();*/
     })
     ); } });
$('div.sub-menu')。每个(函数(){
var max=8
if($(this).find(“li”).length>max){
$(this.find('li:gt('+max+')).hide();
$(this).find('li:eq('+max+'))。之后(
$('li class=“more”>more>')。单击(函数(){
/*$(this.sides().show()*/
/*$('ul.child').children().show()*/
/*$(this.remove()*/
})
); } });
请给我提供任何解决方案,这是网址,这将是很容易理解我想说什么

在这里:

$('.sub-menu').each(function(){
  var max = 8
  if ($(this).find("li").length > max) {
    $(this).find('li:gt('+max+')').hide();
    $(this).find('li:eq('+max+')').after(

    $('<li class="more">More >></li>').click( function(){

    location.href=$(this).parent().parent().prev().attr('href');

         /*$(this).siblings().show();
          $('ul.child').children().show();
         $(this).remove();*/
        })

    );
  }
});
$('.sub-menu')。每个(函数(){
var max=8
if($(this).find(“li”).length>max){
$(this.find('li:gt('+max+')).hide();
$(this).find('li:eq('+max+'))。之后(
$('li class=“more”>more>')。单击(函数(){
location.href=$(this.parent().parent().prev().attr('href');
/*$(this.sides().show();
$('ul.child').children().show();
$(this.remove()*/
})
);
}
});
在这里:

$('.sub-menu').each(function(){
  var max = 8
  if ($(this).find("li").length > max) {
    $(this).find('li:gt('+max+')').hide();
    $(this).find('li:eq('+max+')').after(

    $('<li class="more">More >></li>').click( function(){

    location.href=$(this).parent().parent().prev().attr('href');

         /*$(this).siblings().show();
          $('ul.child').children().show();
         $(this).remove();*/
        })

    );
  }
});
$('.sub-menu')。每个(函数(){
var max=8
if($(this).find(“li”).length>max){
$(this.find('li:gt('+max+')).hide();
$(this).find('li:eq('+max+'))。之后(
$('li class=“more”>more>')。单击(函数(){
location.href=$(this.parent().parent().prev().attr('href');
/*$(this.sides().show();
$('ul.child').children().show();
$(this.remove()*/
})
);
}
});

绝对值得+1。绝对值得+1。