PDA

View Full Version : Problem with getElementByID



tudor.totolici
07-30-2007, 12:31 AM
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!!!


<!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") ?>

tech_support
07-30-2007, 02:34 AM
It needs to be visibility="hidden" not display="none"

thetestingsite
07-30-2007, 03:23 AM
It needs to be visibility="hidden" not display="none"

To my understanding, both are accepted and; actually, both work the same.

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

tech_support
07-30-2007, 09:48 AM
To my understanding, both are accepted and; actually, both work the same.
Not with script.aculo.us