Home >Web Front-end >HTML Tutorial >document.getElementById('') assignment problem_html/css_WEB-ITnose

document.getElementById('') assignment problem_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 11:42:283019browse



<script> <br /> function cc() <br /> { <br /> var cf=window.screen.width; <br /> alert(cf ) <br /> <br /> if(cf<=1920) <br /> { <br /> cf=-(1920-cf)/2 <br /> } <br /> else if(cf>1920) <br /> { <br /> cf=(cf-1920)/2 <br /> } <br /> document.getElementById("m1").style.marginLeft=cf; <br /> alert(cf) <br /> } <br /> </ script> <br /> <br /> <br /> <body onLoad="cc()"> <br /> <div style=" width:100%; overflow:hidden;" id=" a"> <br /> <div style="width:1920px; height:500px;" id="m1"><img src="/static/imghwm/default1.png" data-src="images/bar3.png" class="lazy" style="max-width:90%" height="500 " text-align:center alt="document.getElementById('') assignment problem_html/css_WEB-ITnose" > <br /> <br /> <br /> </script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn