I trying create a responsive site and need see where is page break in my current layout then i think about something that tell me it putting te current window size in each window resize. I see someone telling about responsive layout in this post. A link about the function here. I found this code but cant put to work, now is 01:09, is night here in brazil and im getiing crazy. Someone can help me ? Im testing in chrome. The author tell it put current size in corner of page in em;
<html>
<head>
<title>MediaQuery DBG</title>
<SCRIPT LANGUAGE="JavaScript" SRC="http://code.jquery.com/jquery-1.6.4.js"></SCRIPT>
<script type="text/javascript">
$(document).ready(function() {
var step = 1;
var start = 1;
var end = 2048;
var unit = "em";
var command = "";
var expression = "";
for (cs=start;cs<=end;cs=cs+step)
{
expression = "screen and (min-device-width: "+(cs-step)+unit") and (max-device-width: "+(cs)+unit")";
command = "var mql = window.matchMedia("+expression+");" +
"function handleOrientationChange(mql) {" +
" if (mql.matches) {" +
" $(\"#lblmq\").replaceWith( \"<div id='lblmq'>tamanho: "+cs+"</div>\" ); " +
" }" +
"}";
command = "mql.addListener("+command+");"
eval(command);
});
</script>
<style>
#lblmq
{
background-color: #789;
width:20em;
}
</style>
</head>
<body >
<div id='lblmq'></div>
</body>
</html>