Created
May 5, 2020 03:48
-
-
Save punit5658/075651dc9b2daf3995e8dda4a4013455 to your computer and use it in GitHub Desktop.
Composite Product Options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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