...

View Full Version : onresize event not working



jabcka
05-09-2006, 01:44 PM
Hi
I'm trying to set an onresize event.
The problem is that it's not working.

After 5 minutes with thw same page open - it works ok.

What reasons can cause this?
Thanks

Nischumacher
05-09-2006, 02:25 PM
MaY Be BeCauSe THe oNReSiZe eVeNT iS RaiSeD aFTeR 5 MiNuTeS... ;)

PLeaSe PoST THe CoDe... aND HeLP uS iN HeLPiNG You
:)

jabcka
05-09-2006, 04:36 PM
something like this:

<html>

<head>
<style>
body, form, textarea {
padding:0;
margin:0px;
font-family:arial;
font-size:12px;
color:#000;
}

#pagewidth{
width:900px;
text-align:left;
margin: 0 auto 0 auto;
}

#twocols{
width:900px;
float:right;
position:relative;
}

#rightcol{
width:120px;
float:right;
position:relative;
margin:0;
vertical-align:top;
}

#maincol{background-color: #FFFFFF;
float: left;
display:inline;
position: relative;
width:776px;
}

/* *** Float containers fix:
http://www.csscreator.com/attributes/containedfloat.php *** */
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

.clearfix{display: inline-table;}

/* Hides from IE-mac \*/
* html .clearfix{height: 1%;}
.clearfix{display: block;}
/* End hide from IE-mac */

</style>
<script language="javascript" type="text/javascript">
if (self.innerWidth - 16 <= 900){
document.write("<" + "style" + ">\n");
document.write("#" + "pagewidth" + "{ width:776px; margin:0 auto 0 auto;text-align:center; float:none;}\n");
document.write("#" + "twocols" + "{ width:776px; margin:0 auto 0 auto;text-align:center; float:none;}\n");
document.write("<" + "/style" + ">");
}

function checkSize(){

if (document.body.offsetWidth > 900 ){
alert(1);
}
else {

alert(2);
}
}
function goTo(url){
return true;
}

</script>

</head>

<body>
<div id="pagewidth" >
<div id="wrapper" class="clearfix" >
<div id="twocols" class="clearfix">
<div id="maincol">
main col

</div> <!-- maincol -->
<div id="rightcol">
right col<br>
right col<br>
right col<br>
right col<br>
right col<br>
</div>
</div>
</div>
</div>
<script language="JavaScript" type="text/javascript">
checkSize();
</script>
</body>

</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum