<script type= ' Text/javascript ' > $(function(){ varScreenWidth =$ (window). width (); varScreenHeight =$ (window). Height (); //console.log (screenwidth+ '//' +screenheight); varScreenscale = Screenwidth/screenheight;varImgWidth = $ ('. BANNER6 img ')). width (); varImgHeight = $ ('. BANNER6 img ')). Height (); varscale = Imgwidth/imgheight;if(Screenscale >Scale ) { $('. Banner6 img '). Width (screenwidth);//to the width of the standard$ ('. BANNER6 img '). Height (Screenwidth/scale);//Console.log (' one: ' + $ ('. BANNER6 img '). Width () + ': ' +$ ('. Banner6 img '). Height ());}Else{ $('. Banner6 img '). Width (screenheight*scale);//high as the standard$ ('. Banner6 img '). Height (screenheight); //Console.log (' $: ' + $ ('. BANNER6 img '). Width () + ': ' +$ ('. Banner6 img '). Height ()); } }) </script>
JavaScript JavaScript implements Background-size:cover functionality