<script type="text/javascript">
window.onload = widthFunction();
window.onresize = function widthFunction(){
var viewportWidth;
var fouronefour;
rotdiv = document.getElementById("rotationdiv");
viewportWidth = window.innerWidth;
fouronefour = 414;
if(parseInt(viewportWidth) < parseInt(fouronefour))
{rotdiv.style = "visibility:visible;";}
}
</script>
<body>
<div id="rotationdiv" style="visibility:collapse;">If you would like to see more columns, click <a href="WiderPage.aspx">here</a>.</div>
</body>
I know there is a problem with window.onload = widthFunction();. What I basically want this function to do is “on load and on resize, check the screen size. if the screen size is more than 414px, display the div asking the client to go to a wider page.”
It’s a gridview with many boundfields. I figured I’d try this because I’m scaling my website down to a mobile browser
This:
Should be