Results 1 to 5 of 5

Thread: Problem with getElementByID

  1. #1
    Join Date
    Jul 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem with getElementByID

    I am trying to use prototype to make some cool search forms but it dosen't seem to work. the code is down and you can see the page at www.more-group.eu/en

    Can anyone pls help me!!!

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="style/style.css" rel="stylesheet" type="text/css" />
    <link href="style/menu.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="style/lightbox.css" media="screen,projection" type="text/css" />
    <script type="text/javascript" src="scripts/anylink.js"></script>
    <script type="text/javascript" src="scripts/prototype.js"></script>
    <script type="text/javascript" src="scripts/lightbox.js"></script>
    <script type="text/javascript" src="scripts/scriptaculous.js"></script>
    <script type="text/javascript" src="rssticker.js"></script>
    <script>
    function pop1()
    {
    document.getElementById("d2").style.display = "none";
    document.getElementById("d3").style.display = "none";
    document.getElementById("d4").style.display = "none";
    document.getElementById("d5").style.display = "none";
    }
    </script>
    <script>
    function pop2()
    {
    document.getElementById("d1").style.display = "none";
    document.getElementById("d3").style.display = "none";
    document.getElementById("d4").style.display = "none";
    document.getElementById("d5").style.display = "none";
    }
    </script>
    <script>
    function pop3()
    {
    document.getElementById("d1").style.display = "none";
    document.getElementById("d2").style.display = "none";
    document.getElementById("d4").style.display = "none";
    document.getElementById("d5").style.display = "none";
    }
    </script>
    <script>
    function pop4()
    {
    document.getElementById("d1").style.display = "none";
    document.getElementById("d2").style.display = "none";
    document.getElementById("d3").style.display = "none";
    document.getElementById("d5").style.display = "none";
    }
    </script>
    <script>
    function pop5()
    {
    document.getElementById("d1").style.display = "none";
    document.getElementById("d2").style.display = "none";
    document.getElementById("d3").style.display = "none";
    document.getElementById("d4").style.display = "none";
    }
    </script>
    <title>MORE International Invest</title>
    </head>
    <body>
    <table id="general" width="900" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2"><?php include("includes/header.php") ?></td>
      </tr>
      <tr>
        <td width="230" valign="top"><?php include("includes/left.php") ?></td>
        <td valign="top">
        <table width="100&#37;" align="center" cellpadding="0" cellspacing="0" style="margin-top:20px">
        <tr><td>
        <p id="titlupagina">Bucharest</p>
        <a href="#" onclick="pop1(); new Effect.SlideDown('d1'); return false;"><img style="margin-left:11px; border:0" src="images/lands.jpg" alt="Lands" width="117" height="213" /></a>
        <a href="#" onclick="pop2(); new Effect.SlideDown('d2'); return false;"><img style="margin-left:11px; border:0" src="images/apartments.jpg" alt="Apartments" width="117" height="213" /></a>
        <a href="#" onclick="pop3(); new Effect.SlideDown('d3'); return false;"><img style="margin-left:11px;" border="0" src="images/office.jpg" alt="Office" width="117" height="213" /></a>
        <a href="#" onclick="pop4(); new Effect.SlideDown('d4'); return false;"><img style="margin-left:11px;" border="0" src="images/industrial.jpg" alt="Industrial" width="117" height="213" /></a>
        <a href="#" onclick="pop5(); new Effect.SlideDown('d5'); return false;"><img style="margin-left:11px;" border="0" src="images/retail.jpg" alt="Retail" width="117" height="213" /></a><br />
        </td></tr>
        <tr>
          <td>
    <div id="d1" style="overflow:hidden; display:none"><div style="background-image:url(images/search_b.png); background-repeat:no-repeat;  margin:0px 11px 10px 11px; height:150px; padding:30px 20px 20px 20px;">
      Search
    </div></div>
    
    <div id="d2" style="overflow:hidden; display:none"><div style="background-image:url(images/search_b2.png); background-repeat:no-repeat; margin:0px 11px 10px 11px; height:150px; padding:30px 20px 20px 20px;">
      Search
    </div></div>
    
    <div id="d3" style="overflow:hidden; display:none"><div style="background-image:url(images/search_b3.png); background-repeat:no-repeat; margin:0px 11px 10px 11px; height:150px; padding:30px 20px 20px 20px;">
      Search
    </div></div>
    
    <div id="d4" style="overflow:hidden; display:none"><div style="background-image:url(images/search_b4.png); background-repeat:no-repeat; margin:0px 11px 10px 11px; height:150px; padding:30px 20px 20px 20px;">
      Search
    </div></div>
    
    <div id="d5" style="overflow:hidden; display:none"><div style="background-image:url(images/search_b5.png); background-repeat:no-repeat; margin:0px 11px 10px 11px; height:150px; padding:30px 20px 20px 20px;">
      Search
    </div></div>
    
    </td>
        </tr>
        <tr><td style="text-align:center;"><object type="application/x-shockwave-flash" data="harta.swf" width="651" height="435" title="harta">
          <param name="movie" value="harta.swf" />
        </object>
        </td>
        </tr>
        </table>
        </td>
      </tr>
      <?php include("includes/footer.php") ?>

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    It needs to be visibility="hidden" not display="none"
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by tech_support View Post
    It needs to be visibility="hidden" not display="none"
    To my understanding, both are accepted and; actually, both work the same.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. #4
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    visibility:hidden - makes the element invisible (still fills up space)
    display:none - collapses the element (as if it weren't there to begin with)
    Trinithis

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    To my understanding, both are accepted and; actually, both work the same.
    Not with script.aculo.us
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

Bookmarks

Posting Permissions

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