Ok, I got the jQuery working from another tutorial. I just need to know how to float the results box over everything without pushing it down.
Start typing the letters "eu" in the box in the link below. As you can see, results populate, but the mouseover does not highlight the row, and worse off, the rest of the page is pushed downward. I would like the list to float over the links below the box.
http://www.mathcelebrity.com/topmenu2.php
At the top I include this file:
Code:
<script type="text/javascript" src="js/jquery-1.5.min.js"></script>
PHP Code:
<table><tr>
<td><div id='tmenu'><a href="index.php" name="top"><img border="0" src="/images/mchotness.gif" alt="Math Celebrity Homepage"></a></td></div>
<td align='right'>
<form action="namesearch.php" name="searchForm" method="get"><a href='azlist.php?letter=A' title='Click for Alphabetical Lesson Index' id='quizm' style='color:blue'>A-Z Index</a>
<a href='pcinst.php' title='Click for Problem Cipher shortcut commands' id='quizm' style='color:blue'>Shortcut Commands</a>
<input type="text" name="searchInput" id="sbox" maxlength="150" size="18" value="" onkeyup="lookup(this.value)"> <input TYPE="submit" id="sbox" VALUE="GO!" name="pl" onblur="fill();">
<div class="suggestionsBox" id="suggestions" style="display: none;">
<div class="suggestionList" id="autoSuggestionsList">
</div>
</div>
<script type="text/javascript">
function lookup(inputString) {
if(inputString.length == 0) {
$('#suggestions').hide();
} else {
$.post("calcsave.php", {xterm: ""+inputString+""}, function(data){
if(data.length >0) {
$('#suggestions').show();
$('#autoSuggestionsList').html(data);
}
});
}
}
function fill(thisValue) {
$('#sbox').val(thisValue);
setTimeout("$('#suggestions').hide();", 200);
}
</script>
<?php
echo "<div id='quizm'>";
$mcyn=$_SESSION['mcyn'];
$mcid=$_SESSION['mcid'];
if ($mcyn==1 || strlen($mcid)==16){
echo "Hello, <a href='mcmember.php' title='Click to go to your MyMathCelebrity page'>" . $_SESSION['emaddr'] . "</a>";
echo "<br />";
// logout link
echo "<a href='logout.php' title='Click to logout of your MyMathCelebrity account'>Logout?</a> </a>";
}
else{
echo "Status: Guest <a href='login.php' title='Click to login to Math Celebrity'>Login</a> or <a href='signup.php' title='Click to sign up for Math Celebrity'>Sign Up</a>";
echo "<br />";
}
?>
Trend: <a href="trend.php?tstopday=1" title="Click to see most popular trends in the last 24 hours">1 day</a> |
<a href="trend.php?tstopday=3" title="Click to see most popular trends in the last 3 days">3 day</a> |
<a href="trend.php?tstopday=7" title="Click to see most popular trends in the last 7 days">7 day</a></form>
</td>
</tr></table></div>
And the .css:
PHP Code:
.suggestionsBox {
position: relative;
left: 0px;
margin: 0px 0px 0px 0px;
width: 180px;
background-color: black;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border: 2px solid #000;
color: #FC0;
}
.suggestionList {
margin: 0px;
padding: 0px;
}
.suggestionList li {
margin: 0px 0px 3px 0px;
padding: 2px;
cursor: pointer;
}
.suggestionList li:hover {
background-color: #DD45CD;
}