Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onresize event not working

    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

  • #2
    Regular Coder Nischumacher's Avatar
    Join Date
    Oct 2005
    Location
    Bombay, India
    Posts
    196
    Thanks
    0
    Thanked 2 Times in 2 Posts
    MaY Be BeCauSe THe oNReSiZe eVeNT iS RaiSeD aFTeR 5 MiNuTeS...

    PLeaSe PoST THe CoDe... aND HeLP uS iN HeLPiNG You
    - NS 666
    .net DEVILoper

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •