1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Resolved Javascript wizards?

Discussion in 'General Internet' started by smokinjoe, 2012/05/21.

  1. 2012/05/21
    smokinjoe

    smokinjoe Inactive Thread Starter

    Joined:
    2003/10/25
    Messages:
    40
    Likes Received:
    0
    I'm rebuilding a web page for an organization that I belong to and I'm having problems centering a javascript reflecting image on the page.
    Is there anyone out there that would like to take a stab at it? I'll copy/paste the code if you're interested, or I can e-mail it.

    Thanks in advance
     
  2. 2012/05/21
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,315
    Likes Received:
    252
    Go ahead and post the code....Maybe someone can help;)
     

  3. to hide this advert.

  4. 2012/05/21
    smokinjoe

    smokinjoe Inactive Thread Starter

    Joined:
    2003/10/25
    Messages:
    40
    Likes Received:
    0
    Here's a screen capture. I need to move the image to the top center.



    Here's the page code:
    *****************************************************

    <html>
    <head>
    <meta http-equiv= "content-type" content= "text/html;
    charset=ISO-8859-1 ">
    <title>florians-index</title>
    <link rel= "stylesheet" href= "index_files/reset.css ">
    <script type= "text/javascript" src= "index_files/jquery.js "></script>
    <script type= "text/javascript" src= "index_files/lake.txt "></script>
    <script type= "text/javascript ">
    $(function() {
    $('#lake-img').lake({
    'waves': 6,
    'scale': 0.5
    });

    $('#lake-img2').lake();

    $('#lake-img3').lake({
    'speed': 1.5,
    'scale': 1.5
    });
    });
    </script>
    <style type= "text/css ">
    body { font-size: 10px; }
    h1 { font-size: 10px; }
    h2 { font-size: 10px; }
    h3 { font-size: 10px; }

    body { font-family: sans-serif; line-height: 1.5; }
    pre { font-family: monospace; ; white-space: pre-wrap; font-size: 12px;}
    h1,h2,h3 { font-family: 'Palatino Linotype', serif ; }

    strong { font-weight: bold; }

    p { margin-bottom: 10px; }
    h2 { margin-bottom: 10px; margin-top: 1px; }

    h2 { border-bottom: 1px solid #aaa; padding-bottom: 6px; }
    h3 { padding-bottom: 6px; }

    h1 { color: #269; }

    canvas { float: center; }

    #lakes { overflow: hidden; }
    #container {
    width: 720px;
    margin: 1px auto;
    }
    </style>
    </head>
    <body style=" color: rgb(0, 0, 0); background-color: rgb(11, 22, 42); "
    alink= "#EE0000" link= "#0000EE" vlink= "#551A8B ">
    <div id= "container ">
    <p><br>
    </p>
    <div id= "lakes "> <canvas height= "218" width= "530 "></canvas><img
    id= "lake-img" src= "index_files/florians-logo.jpg "
    style= "display: none; "> </div>
    </div>
    <div style= "text-align: center; "><br>
    </div>
    </body>
    </html>
     

    Attached Files:

  5. 2012/05/21
    dnmacleod

    dnmacleod Well-Known Member

    Joined:
    2009/05/16
    Messages:
    419
    Likes Received:
    58
    The positioning isn't controlled by the javascript, its controlled by the CSS rules.

    Change the properties of the "canvas" tag by taking out the float property and make it absolute thus:

    canvas {
    position: absolute;
    left: 133px;
    top: 19px;
    }

    use the left and top properties to position it as required.
     
    smokinjoe likes this.
  6. 2012/05/21
    smokinjoe

    smokinjoe Inactive Thread Starter

    Joined:
    2003/10/25
    Messages:
    40
    Likes Received:
    0
    Thanks a million, Don! It worked like a champ!
     
  7. 2012/05/23
    Admin.

    Admin. Administrator Administrator Staff

    Joined:
    2001/12/30
    Messages:
    6,687
    Likes Received:
    107
    Please mark your thread as 'Resolved'.

     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.