'; // close .image-feature.video-feature primeMediaContainer.insertAdjacentHTML('beforeend', htmlTemplate); // iframe "pause" $('#video_'+ videoId).on('hidden.bs.modal', function (e) { var playingSrc = $('#pm-iframe-container'+ videoId + ' iframe').attr('src'); $('#pm-iframe-container'+ videoId + ' iframe').attr('src', ''); $('#pm-iframe-container'+ videoId + ' iframe').attr('src', playingSrc); }); htmlTemplate = ''; } }); } if (res.length === 0) { document.querySelector('a[href="#tab-pane-video"]').style.display = 'none'; } }); for (i = 0; i <= 0; i++) { var ImagefeatureVideo = '#feature_' + i; $(ImagefeatureVideo).on('hide.bs.modal',generateModalVideoOnClose(ImagefeatureVideo)); } for (i = 0; i <= 0; i++) { var generalVideo = '#video_' + i; $(generalVideo).on('hide.bs.modal',generateModalVideoOnClose(generalVideo)); } $('.add-on-item-cta input').click(function(){ // accessories add to cart input checked the label will swap $(this).siblings('label').find('span').toggleClass('hidden'); }).filter(':checked').each(function(){ $(this).siblings('label').find('span').toggleClass('hidden'); // Incase the page is refreshed and has a checkbox is checked. }); $('.owl-carousel').owlCarousel({ loop:true, autoplay: false, slideBy:"page", dots: false, margin:20, itemsScaleUp: false, nav: true, navText: [ "", "" ], responsiveClass:true, responsive:{ 0:{ items:2, nav:true, loop:false }, 768:{ items:4, nav:false, loop:false }, 992:{ items:5, nav:true, loop:false } } }); $("#added_to_cart_success_dialog").on('hide.bs.modal', function () { location.reload(); }) }); $(window).resize(function() { setHeight('#price-block-slide-panels'); }); var execute_check = true; setTimeout(function() { execute_check = false; }, 1200000); // Stop checking for prices after 20 minutes // Checks for price change on the current item function checkForPriceChange() { if ( execute_check != true ) return; // Don't check prices if enough time has passed, so we can avoid hitting the server over and over if a page is left idle var cur_sale_price = "$468"; var item_key = 'ASHLEY:B560B4'; var rule_name = "SALE"; if (cur_sale_price && item_key) { var url = "/check_for_rule_value_changes.html?original_values=" + item_key + ":sale:" + cur_sale_price; rwsAJAXPostAJAX(url,'',false,priceResponse); } // try the price change every 30 seconds setTimeout(checkForPriceChange, 30 * 1000); } function priceResponse(response) { var price_change_warning_container = document.getElementById('price_change_warning'); price_change_warning_container.innerHTML = ''; if (response && response.length > 0) { price_change_warning_container.style.display = 'block'; price_change_warning_container.innerHTML = '