Jump to content

need help on my side menu


pixeltrace

Recommended Posts

hi,

 

please check this

http://www.phpfreaks.com/forums/index.php/board,1.0.html

currently i am using ajax in my right menu

in mozilla i dont see any errors, but in IE, whenever i rollover the buttons

ex. about us, our schools, etc, a space on the bottom of the menu

suddenly appears and i dont know where is it coming.

 

one of my friend told me that i can use

hide/unhide on this one better than ajax.

(style.visibility) but i dont know how to make it work.

 

 

hope you could help me with this.

if you need to check the code of my page

this is the code for abttest.htm

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>KAPLAN SINGAPORE: Website Design Concept</title>
<style type="text/css">
<!--
body {
background-color: #330066;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">

function Load() {
		document.getElementById("my_site_content").innerHTML = "<img src='images/menu/about.jpg'>";
}
</script>
<script type="text/javascript" src="ajax_navigation.js"></script>

</head>

<body onload= Load()">
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
  <tr>
    <td width="950"><table width="950" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td width="485" rowspan="12" valign="top"><img src="images/logo.gif" width="485" height="80" /><img src="images/main-abt.jpg" width="485" height="270" /></td>
        <td width="155" valign="top"><img src="images/menu/spacer.gif" width="1" height="31" /></td>
        <td width="310" rowspan="12" valign="top"><span id="my_site_content"></span></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:void(0)" onmouseover="open_url('aboutus.html','my_site_content')"><img src="images/menu/aboutus.gif" name="Aboutus" width="155" height="27" border="0" id="Aboutus" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:void(0)" onmouseover="open_url('school.html','my_site_content')"><img src="images/menu/school.gif" name="school" width="155" height="29" border="0" id="school" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:void(0)" onmouseover="open_url('programme.html','my_site_content')"><img src="images/menu/programme.gif" name="programme" width="155" height="28" border="0" id="programme" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:;"><img src="images/menu/partner.gif" width="155" height="28" border="0" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:;"><img src="images/menu/academic.gif" width="155" height="32" border="0" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:;"><img src="images/menu/career.gif" width="155" height="27" border="0" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:;"><img src="images/menu/news.gif" width="155" height="31" border="0" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:;"><img src="images/menu/resource.gif" width="155" height="29" border="0" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:void(0)" onmouseover="open_url('community.html','my_site_content')"><img src="images/menu/community.gif" name="community" width="155" height="33" border="0" id="community" /></a></td>
      </tr>
      <tr>
        <td valign="top"><a href="javascript:;"><img src="images/menu/contact.gif" width="155" height="27" border="0" /></a></td>
      </tr>
      <tr>
        <td width="155" valign="top"> </td>
      </tr>
      <tr>
        <td colspan="3" valign="top"><img src="images/search.jpg" width="950" height="304" /></td>
      </tr>
      <tr>
        <td colspan="3" valign="top"><img src="images/footer.jpg" width="950" height="36" vspace="10" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

 

 

and this is the code of my ajax_navigation.js

/* Ultimater's edited version of:
   http://jibbering.com/2002/4/httprequest.html
   to serve IE7 with XMLHttpRequest instead of ActiveX */

var xmlhttp=false;
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		 xmlhttp = new XMLHttpRequest();
	} catch (e) {
		 xmlhttp=false;
	}
}

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
if (!xmlhttp){
try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
}
}
@end @*/

if (!xmlhttp && window.createRequest) {
try {
	xmlhttp = window.createRequest();
} catch (e) {
	xmlhttp=false;
}
}

/* Ultimater's edited version of:
   http://javascript.internet.com/ajax/ajax-navigation.html */

var please_wait = "";

function open_url(url, targetId) {
  if(!xmlhttp)return false;
    var e=document.getElementById(targetId);if(!e)return false;
    if(please_wait)e.innerHTML = please_wait;
    xmlhttp.open("GET", url, true);
    xmlhttp.onreadystatechange = function() { response(url, e); }
    try{
      xmlhttp.send(null);
    }catch(l){
    while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
    e.appendChild(document.createTextNode("request failed"));
  }
}

function response(url, e) {
  if(xmlhttp.readyState != 4)return;
    var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the following error code: " + xmlhttp.status+" "+xmlhttp.statusText;
    var d=document.createElement("div");
    d.innerHTML=tmp;
    setTimeout(function(){
      while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
      e.appendChild(d);
    },10)
}

 

hope you could help me with this.

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/56956-need-help-on-my-side-menu/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.