Guest User

Untitled

a guest
Oct 21st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. jQuery(document).ready(function() {
  2. // Selects swatch by default if there is only 1 displayed
  3. jQuery("#your-swatch-parent-class").each(function(){
  4. var swatches = jQuery(this).find('li'),
  5. numswatches = swatches.length;
  6. if (numswatches === 1) {
  7. jQuery(this).find("span").trigger("click");
  8. };
  9. });
  10. });
Add Comment
Please, Sign In to add comment