customfiy

Rubah option front dan back dengan variant

May 4th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <script>
  2. jQuery(document).ready(function(){
  3. setTimeout(function() {
  4. jQuery('select.single-option-selector').on('change', function() {
  5. var selectLabel = jQuery(this).prev().text().trim();
  6. if(selectLabel === "Color"){
  7. var selectedopt = parseInt( jQuery(this).prop("selectedIndex") );
  8. jQuery("#cst-container #side-switcher .product-switch:nth-child(" + (selectedopt + 1) + ") img").trigger("click");
  9. }
  10. });
  11. }, 1000);
  12. });
  13. /*$("#productSelect-option-0").change(function () {
  14. var val = parseInt($("#productSelect-option-0").val());
  15. console.log(val);
  16. });*/
  17. </script>
Add Comment
Please, Sign In to add comment