(function ($) {
	"use strict";
	var WidgetHoverBackground = function ($scope, $) {
			var items = 0;
			var item  = $scope.find( ".eca-hover-background-wrapper .eca-hb-wrapper" );
			item.each(
				function () {
					var bgoverlay = 20;
					if (items == 0) {
						var bgimage = $( this ).data( 'bgimage' );
						$( this ).closest( 'section.elementor-element,.elementor-element.e-container,.elementor-element.e-con' ).css( 'background','url(' + bgimage + ') center/cover' ).css( 'transition', 'background 0.3s linear' );
					}
					items++;
				}
			);
			item.on(
				"mouseenter",
				function () {
					var bgimage = $( this ).data( 'bgimage' );
					$( this ).closest( 'section.elementor-element,.elementor-element.e-container,.elementor-element.e-con' ).css( 'background','url(' + bgimage + ') center/cover' );
				}
			);

	};

	$( window ).on(
		'elementor/frontend/init',
		function () {
			elementorFrontend.hooks.addAction( 'frontend/element_ready/ecafe-hover-background.default', WidgetHoverBackground );
		}
	);
})( jQuery );