$( document ).ready( function() { $('[data-toggle="tooltip"]').tooltip({ html: true }) $('[data-bs-toggle="tooltip"]').tooltip({ html: true }) $( ".gallery-thumb" ).click(function (event) { event.preventDefault(); event.stopPropagation(); var src = $(this).attr('href'); $( "#gallery-big-img" ).attr('src',src); $( ".gallery-thumbs .active" ).removeClass( "active" ); }); //PRODUCTOVERZICHT // rood opkleuren bij focus/wijziging $('.overzichtinput').click(function() { $(this).parent().css("background-color","red"); }); //IMG PREVIEW $('.preview').anarchytip(); $('.preview').click(function( event ) { event.preventDefault(); }); //PRODUCT OVERZICHT // This button will increment the value $('[data-quantity="plus"]').click(function(e){ // Stop acting like a button e.preventDefault(); // Get the field name fieldName = $(this).attr('data-field'); // Get its current value var currentVal = parseInt($('input[name='+fieldName+']').val()); // If is not undefined if (!isNaN(currentVal)) { // Increment $('input[name='+fieldName+']').val(currentVal + 1); } else { // Otherwise put a 0 there $('input[name='+fieldName+']').val(1); } //UPDATE CALC-PRIJS try { calcprijs(fieldName); } catch(err) {} }); // This button will decrement the value till 0 $('[data-quantity="minus"]').click(function(e) { // Stop acting like a button e.preventDefault(); // Get the field name fieldName = $(this).attr('data-field'); // Get its current value var currentVal = parseInt($('input[name='+fieldName+']').val()); // If it isn't undefined or its greater than 0 if (!isNaN(currentVal) && currentVal > 0) { // Decrement one $('input[name='+fieldName+']').val(currentVal - 1); } else { // Otherwise put a 0 there $('input[name='+fieldName+']').val(''); } //UPDATE CALC-PRIJS try { calcprijs(fieldName); } catch(err) { alert('ERROR');} }); });