User:Jdlrobson/common.js

setTimeout( function {	function positionBanner( $container ) {		/**		 * Javascript to fine tune position of banner according to position coordinates.		 */		// extract position parameters		var offsetY = 0, 			offsetX = 0,			$wpbBannerImage = $container.find( '.wpb-banner-image' ),			centerX = $wpbBannerImage.data( 'pos-x' ),			centerY = $wpbBannerImage.data( 'pos-y' );

// reset translations applied by css $wpbBannerImage.css( {			transform: 'translate(0)',			MozTransform: 'translate(0)',			WebkitTransform: 'translate(0)',			msTransform: 'translate(0)',			'margin-left': 0,			'margin-top': 0		} ); // Adjust focus if ( centerX !== undefined ) { offsetX = 0.5 * centerX * 100; offsetY = 0.5 * centerY * 100; }

// shift the banner horizontally and vertically by the offsets calculated above $wpbBannerImage.css( {			'margin-top': offsetY + '%',			'margin-left': offsetX + '%'		} ); }	var $wpbBannerImageContainer = $( '.wpb-topbanner' ); positionBanner( $wpbBannerImageContainer ); }, 1000 );