Speed up your Oxygen workflow

with Hydrogen Pack

A true Oxygens Editor Enhancer
Starts from $19.99

Resize image from inside container to the one edge of the page

Resize image inside a container on one side to the edge of the page.

jQuery(document).ready(function($) {

// Hero Image scale and position
var adjust_size = function() {

	var newWindowWidth = $(window).width();
	if (newWindowWidth > 992){

		var winW = $(window).width();
		var conW = $(".container").width();
		
		var left = ((winW - conW) / 2 ) + 40;
		var size = ((conW / 3) * 2) + ((winW - conW) / 2) ;
		
		$(".hero-img").css("left", -left);
		$(".hero-img").css("width", size);	
	}

  	else{

  		$(".var").css("left", "0px");

  	}
	
};
adjust_size();
$(window).resize(adjust_size);


// alert("Hello! I am an alert box!! 'winW'");

});
  • + 40 is column padding size
  • If you want to resize it on the right change left to right on lines 15 and 21
  • .container is image wrap
  • .hero-img is img class

Important set img to:

max-width: unset !important;
position:relative;

If you need help with custom scripts or you are not skilled enough to implement something from the tutorial?

HIRE ME

Stay up to date with latest post and updates.