var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo image zoom
oceanwpWooImageZoom();
} );
/* ==============================================
WOOCOMMERCE IMAGE ZOOM
============================================== */
function oceanwpWooImageZoom() {
"use strict"
// wc_single_product_params is required to continue.
if ( typeof wc_single_product_params === 'undefined' ) {
return false;
}
/**
* Product gallery class.
*/
var ProductGallery = function( $target, args ) {
this.$target = $target;
this.$images = $j( '.woocommerce-product-gallery__image', $target );
// No images? Abort.
if ( 0 === this.$images.length ) {
this.$target.css( 'opacity', 1 );
return;
}
// Make this object available.
$target.data( 'product_gallery', this );
// Pick functionality to initialize...
this.zoom_enabled = $j.isFunction( $j.fn.zoom ) && wc_single_product_params.zoom_enabled;
// ...also taking args into account.
if ( args ) {
this.zoom_enabled = false === args.zoom_enabled ? false : this.zoom_enabled;
}
// Bind functions to this.
this.initZoom = this.initZoom.bind( this );
if ( this.zoom_enabled ) {
this.initZoom();
$target.on( 'woocommerce_gallery_init_zoom', this.initZoom );
}
};
ProductGallery.prototype.initZoom = function() {
var zoomTarget = this.$images,
galleryWidth = this.$target.width(),
zoomEnabled = false;
$j( zoomTarget ).each( function( index, target ) {
var image = $j( target ).find( 'img' );
if ( image.data( 'large_image_width' ) > galleryWidth ) {
zoomEnabled = true;
return false;
}
} );
// But only zoom if the img is larger than its container.
if ( zoomEnabled ) {
var zoom_options = {
touch: false
};
if ( 'ontouchstart' in window ) {
zoom_options.on = 'click';
}
zoomTarget.trigger( 'zoom.destroy' );
zoomTarget.zoom( zoom_options );
}
};
/**
* Function to call wc_product_gallery on jquery selector.
*/
$j.fn.wc_product_gallery = function( args ) {
new ProductGallery( this, args );
return this;
};
/*
* Initialize all galleries on page.
*/
$j( '.woocommerce-product-gallery' ).each( function() {
$j( this ).wc_product_gallery();
} );
}
News – منظمة المهندسين السوريين للإعمار والتنمية
SECD published the annual report for the year 2022, during which multi-faceted strategic projects were implemented, the projects focused on […]
The organization implemented multi-faceted strategic projects during the year 2021, focusing on improving infrastructure and supporting sectors Water, solid waste […]
You can see the people’s joy through these photos at Bsheriyeh while they got the safe water in their houses […]
In order to preserve the environment, enhance personal hygiene and prevent the spread of the COVID-19 epidemic, the SECD continues […]
In the context of supporting the water sector to provide safe drinking water in northern Syria, SECD replaced the submersible […]
To enhance the hygiene as well as prevent and/or mitigate the diseases and Covid-19 pandemic, Syrian Engineers for Construction and […]
In order to enhance personal hygiene and prevent the spread of epidemics and diseases caused by the random and uncovered […]
In the context of supporting the water sector to provide safe drinking water and to promote personal hygiene, SECD completed […]
SECD has formed voluntary #Emergency Intervention Teams in 76 IDP sites located in northwest #Syria as part of its #CCCM […]
In the context of supporting the solid waste management, and promoting personal hygiene, and preventing the spread of the #COVID19 […]
In order to ensure the sustainable of pumping the #water and to promot the personal hygiene and prevention of the […]
32 electricity and water network trainings have been conducted until 14 / September /2021 in the project of Rapid emergency […]