92 lines
3.1 KiB
Plaintext
92 lines
3.1 KiB
Plaintext
$("#form-add-comment").submit(function(event){
|
|
var txt=$('#txt').val();
|
|
var tovar_id=$('#tovar_id').val();
|
|
alert(txt);
|
|
$.ajax({
|
|
type:"POST",
|
|
url:'/act/tovar_show',
|
|
data:"txt=" + txt + "&tovar_id=" + tovar_id;
|
|
success:function(data){alert(data)}
|
|
})
|
|
return false;
|
|
})
|
|
$(".min_to_max").click(function(event){//Функция из превьюшек ставит картинку на обложку
|
|
var img=$(this).data('image');
|
|
$("#zoom_01").attr("src", img);
|
|
return false;
|
|
})
|
|
/*$("#zoom_01").elevateZoom({
|
|
gallery:'gallery_01',
|
|
cursor: 'pointer',
|
|
galleryActiveClass: 'active',
|
|
imageCrossfade: true,
|
|
loadingIcon: 'http://www.elevateweb.co.uk/spinner.gif'
|
|
});
|
|
$("#zoom_01").bind("click", function(e) {
|
|
var ez = $('#zoom_01').data('elevateZoom');
|
|
$.fancybox(ez.getGalleryList()); return false;
|
|
});*/
|
|
$("#gallery_01").owlCarousel({
|
|
autoPlay: 3000,
|
|
items:3,
|
|
itemsCustom : false,
|
|
itemsDesktop : [1199,3],
|
|
itemsDesktopSmall : [992,2],
|
|
itemsTablet: [768,2],
|
|
itemsTabletSmall: false,
|
|
itemsMobile : [480,1],
|
|
navigation : false
|
|
});
|
|
$("#owl-demo-post").owlCarousel({
|
|
// autoPlay: 3000,
|
|
items:4,
|
|
itemsCustom : false,
|
|
itemsDesktop : [1199,2],
|
|
itemsDesktopSmall : [992,2],
|
|
itemsTablet: [768,1],
|
|
itemsTabletSmall: false,
|
|
itemsMobile : [480,1],
|
|
navigation : false
|
|
});
|
|
/* [ Add minus and plus number quantity ]
|
|
- - - - - - - - - - - - - - - - - - - - */
|
|
if( $( '.quantity' ).length > 0 ) {
|
|
var form_cart = $( 'form .quantity' );
|
|
form_cart.prepend( '<span class="minus"><i class="fa fa-minus"></i></span>' );
|
|
form_cart.append( '<span class="plus"><i class="fa fa-plus"></i></span>' );
|
|
var minus = form_cart.find( $( '.minus' ) );
|
|
var plus = form_cart.find( $( '.plus' ) );
|
|
minus.on( 'click', function(){
|
|
var qty = $( this ).parent().find( '.qty' );
|
|
if ( qty.val() <= 1 ) {
|
|
qty.val( 1 );
|
|
} else {
|
|
qty.val( ( parseInt( qty.val() ) - 1 ) );
|
|
}
|
|
});
|
|
plus.on( 'click', function(){
|
|
var qty = $( this ).parent().find( '.qty' );
|
|
qty.val( ( parseInt( qty.val() ) + 1 ) );
|
|
});
|
|
}
|
|
$( '.tabs-container' ).each(function() {
|
|
$( this ).find( '.tabs li:first-child a' ).addClass('active');
|
|
$( this ).find( '.tab-content:first' ).show();
|
|
$( this ).find('.tabs li a').click(function(e){
|
|
e.preventDefault();
|
|
var selector = $(this).attr('href');
|
|
$(this).parent().parent().find('a').not(this).removeClass('active');
|
|
$(this).addClass('active');
|
|
$(this).parents('.tabs-container').find('.tab-content').not(selector).slideUp(300);
|
|
$(this).parents('.tabs-container').find(selector).slideDown(300);
|
|
});
|
|
});
|
|
$( this ).find('.section-left').click(function(e){
|
|
e.preventDefault();
|
|
var selector = $(this).attr('href');
|
|
$(this).parent().parent().find('a').not(this).removeClass('active');
|
|
$(this).addClass('active');
|
|
$(this).parents('.section-left').find('.slider-titel').not(selector).slideUp(300);
|
|
$(this).parents('.section-left').find(selector).slideDown(300);
|
|
});
|