Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function() {
- // Selects swatch by default if there is only 1 displayed
- jQuery("#your-swatch-parent-class").each(function(){
- var swatches = jQuery(this).find('li'),
- numswatches = swatches.length;
- if (numswatches === 1) {
- jQuery(this).find("span").trigger("click");
- };
- });
- });
Add Comment
Please, Sign In to add comment