Skip to content

Instantly share code, notes, and snippets.

@punit5658
Created May 5, 2020 03:48
Show Gist options
  • Save punit5658/075651dc9b2daf3995e8dda4a4013455 to your computer and use it in GitHub Desktop.
Save punit5658/075651dc9b2daf3995e8dda4a4013455 to your computer and use it in GitHub Desktop.
Composite Product Options
pageElem = jQuery('html').find('.pagination_elements');
pageElem.children().hide();
pageElem.find('li').slice(0,5).show();
jQuery('.composite_pagination').bind('DOMSubtreeModified', function(a,b){
pageElem = jQuery('html').find('.pagination_elements');
pageElem.children().hide();
if( pageElem.find('.pagination_element_current').nextAll().andSelf().length > 5 ){
pageElem.find('.pagination_element_current').nextAll().andSelf().slice(0,5).show();
}else{
pageElem.find('li').slice(-5).show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment