1

When more link is clicked ,it will redirect to its parent category page.

     $('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();*/
     })
     ); } });

Please provide me any solution ,this is url http://peachvitamins.com/ , that would be easy to understand what I am trying to say.

4

1 回答 1

1

这里是:

$('.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();*/
        })

    );
  }
});
于 2013-07-08T11:47:58.790 回答