Making image width and height as sreensize

<body onresize=”myFunction();”>

</body>

<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script&gt;
<script type=”text/javascript”>
function myFunction() {
var img_obj = $(‘.banner-main’).find(‘img’);
var w = $(window).width();
var h = $(window).height();
var mar_number = $(“body”).css(“margin-top”).replace(/[^0-9]/g, ”);
$(img_obj).attr(‘height’,h – mar_number);
$(img_obj).attr(‘width’,w);
}

jQuery(document).ready(function() {
myFunction();
});
</script>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s