Guest User

Untitled

a guest
Mar 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3.  
  4. function Imagw(thisvalue) {
  5. var slideshow = $('#slider-product-template-2');
  6. theme.slideshows[slideshow] = new theme.Slideshow(slideshow);
  7. // slideshow.flexslider(6);
  8. var $newImgs = slideshow.find(
  9. '.slide[data-img-alt="' + thisvalue + '"]'
  10. );
  11. slideshow.find('.slide').removeClass('rt');
  12. $newImgs.addClass('rt');
  13. var index = slideshow.find('.rt:eq(1)').attr('data-index');
  14. slideshow.flexslider(parseInt(index));
  15. var index_array = []
  16. slideshow.find('.slide').not('.rt').each(function() {
  17. index_array.push($(this).attr('data-index'));
  18. });
  19. $('.flex-control-thumbs > li').removeClass('rt1');
  20. $.each(index_array, function(index, value) {
  21. $('.flex-control-thumbs').find('li:eq(' + parseInt(value) + ')').addClass('rt1');
  22. });
  23. theme.slideshows[slideshow] = new theme.Slideshow(slideshow);
  24. $('.flex-control-thumbs > li').show();
  25. $('.flex-control-thumbs').find('li:eq(0)').hide();
  26. $('.rt1').hide();
  27. }
  28.  
  29.  
  30. $(function() {
  31.  
  32.  
  33. $(document).on('change', 'select', function() {
  34. var thisvalue = $(this).find("option:selected").text();
  35. if(thisvalue == "Vanilla" || thisvalue == "Chocolate"){
  36. Imagw(thisvalue)
  37. }
  38.  
  39. });
  40.  
  41.  
  42.  
  43. $(".tab button").click(function(){
  44. var radioValue = $(this).find("input[name='sele']:checked").val();
  45.  
  46.  
  47. if(radioValue == "one-time-purchase"){
  48. // alert("one-time-purchase");
  49. var text = $('.'+radioValue).find(".jumpstart-selector select option:selected").text();
  50. Imagw(text);
  51. }
  52. else if(radioValue == "monthly-subscription"){
  53. // alert("monthly-subscription");
  54. var text = $('.'+radioValue).find(".jumpstart-selector select.single-option-selector option:selected").text();
  55. Imagw(text);
  56.  
  57. }
  58.  
  59. });
  60.  
  61.  
  62.  
  63. });
  64. </script>
Add Comment
Please, Sign In to add comment