marko krstić

Collections

Archives

Update on load and resize

jQuery(document).ready(function($) {
  var adjust_size = function() {
  	// Change code here
    $('.content .right').width($(window).width() - 480);
	// Change code here
  };
  adjust_size();
  $(window).resize(adjust_size);
});	

This code will help you to get values on page load and change them on resize. It can be useful to update the CSS values and objects position.

Code example with breakpoint

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

// Footer fixed
var adjust_size = function() {

var newWindowWidth = $(window).width();
	if (newWindowWidth > 991) {    
	    var footer = $(".footer").height();
		$(".main").css("margin-bottom", footer)
	}
	else
	{
		$(".main").css("margin-bottom", "0px")
	}
};
adjust_size();
$(window).resize(adjust_size);
// Footer fixed

});

Let's Connect

Feel free to reach out for collaborations or just a friendly hello ?
[email protected]
linkedininstagramdribbblefacebook-official