Online Forum To Support Coders With Technical Assistance - Read Write Execute

Full screen div at any screen and resolution

Ankit Agrawal
Ankit Agrawal
Published on January 12, 2016 · 1 min read

Add this in your javascript file and call this file after jquery file

function fullsize() 
{
	var new_height = window.innerHeight; // get new height of window
	var fullsize = new_height; 
	fullsize = parseInt(fullsize) + 'px'; // concatenate string get output in px format  
	jQuery("div").css('height',fullsize); // changing height of div
}
jQuery(document).ready(function()
{
	fullsize();
	jQuery(window).bind('resize', fullsize); // event is call at screen change ( resolution changes )
});

Note: you can replace ‘jQuery’ with ‘$’ if there is any issue due to ‘jQuery’ Keyword.

Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article Custom log out to home page in wordpress Next Article → Last date of this month in php