You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
1.4 KiB
1 lines
1.4 KiB
!function(a){a.each(["frontend/element_ready/wd_image_hotspot.default"],function(a,b){woodmartThemeModule.wdElementorAddAction(b,function(){woodmartThemeModule.imageHotspot()})}),woodmartThemeModule.imageHotspot=function(){a(".wd-image-hotspot").each(function(){var b=a(this),c=b.find(".hotspot-btn");!b.parents(".wd-image-hotspot-wrapper").hasClass("hotspot-action-click")&&woodmartThemeModule.$window.width()>1024||(c.on("click",function(){return b.hasClass("hotspot-opened")?b.removeClass("hotspot-opened"):(b.addClass("hotspot-opened"),b.siblings().removeClass("hotspot-opened")),woodmartThemeModule.$document.trigger("wood-images-loaded"),!1}),woodmartThemeModule.$document.on("click",function(c){var d=c.target;if(b.hasClass("hotspot-opened")&&!a(d).is(".wd-image-hotspot")&&!a(d).parents().is(".wd-image-hotspot"))return b.removeClass("hotspot-opened"),!1}))}),a(".wd-image-hotspot-wrapper").each(function(){var b=a(this);b.imagesLoaded(function(){b.addClass("loaded")})}),a(".wd-image-hotspot .hotspot-content").each(function(){var b=a(this),c=b.offset().left,d=woodmartThemeModule.$window.width()-(c+b.outerWidth());woodmartThemeModule.$window.width()>768&&(c<=0&&b.addClass("hotspot-overflow-right"),d<=0&&b.addClass("hotspot-overflow-left")),woodmartThemeModule.$window.width()<=768&&(c<=0&&b.css("marginLeft",Math.abs(c-15)+"px"),d<=0&&b.css("marginLeft",d-15+"px"))})},a(document).ready(function(){woodmartThemeModule.imageHotspot()})}(jQuery); |