Reputation: 21
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.
Upvotes: 1
Views: 259
Reputation: 11338
Here it is:
$('.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();*/
})
);
}
});
Upvotes: 1