dynamic menu button problems

Discussion forum for MOD Writers regarding MOD Development.
Locked
micsta
Registered User
Posts: 126
Joined: Tue Apr 22, 2008 11:11 am

dynamic menu button problems

Post by micsta » Wed Oct 13, 2010 11:09 am

I'm using a simple script for some dynamic menu buttons on my forum, everything works fine with FF, but IE and Chrome both fail to display the mouseover images.

Can anyone see a reason for this from the following code?


Code: Select all

<!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" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-language" content="en-au" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="url.com" />
<meta name="keywords" content="" />
<meta name="description" content="" />
{META}
<title>{SITENAME} &bull; {SITE_DESCRIPTION} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>

<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />

<script type="text/javascript">
// <![CDATA[
<!-- IF S_USER_PM_POPUP -->
	if ({S_NEW_PM})
	{
		popup('{UA_POPUP_PM}', 400, 225, '_phpbbprivmsg');
	}
<!-- ENDIF -->

function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}

	window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
	return false;
}

function jumpto()
{
	var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
	var perpage = '{PER_PAGE}';
	var base_url = '{A_BASE_URL}';

	if (page !== null && !isNaN(page) && page > 0)
	{
		document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * perpage);
	}
}

/**
* Find a member
*/
function find_username(url)
{
	popup(url, 760, 570, '_usersearch');
	return false;
}

/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
	var parent = document.getElementById(id);
	if (!parent)
	{
		eval('parent = document.' + id);
	}

	if (!parent)
	{
		return;
	}

	var rb = parent.getElementsByTagName('input');
	
	for (var r = 0; r < rb.length; r++)
	{
		if (rb[r].name.substr(0, name.length) == name)
		{
			rb[r].checked = state;
		}
	}
}

<!-- IF ._file -->

	/**
	* Play quicktime file by determining it's width/height
	* from the displayed rectangle area
	*
	* Only defined if there is a file block present.
	*/
	function play_qt_file(obj)
	{
		var rectangle = obj.GetRectangle();

		if (rectangle)
		{
			rectangle = rectangle.split(',')
			var x1 = parseInt(rectangle[0]);
			var x2 = parseInt(rectangle[2]);
			var y1 = parseInt(rectangle[1]);
			var y2 = parseInt(rectangle[3]);

			var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
			var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
		}
		else
		{
			var width = 200;
			var height = 0;
		}

		obj.width = width;
		obj.height = height + 16;

		obj.SetControllerVisible(true);

		obj.Play();
	}
<!-- ENDIF -->

// ]]>
</script>
<script>

<!--

portalup = new Image; portalup.src = "{T_THEME_PATH}/images/menu/nav_portal.gif";

portaldown = new Image; portaldown.src = "{T_THEME_PATH}/images/menu/nav_portal_f2.gif";

homeup = new Image; homeup.src = "{T_THEME_PATH}/images/menu/portal.png";

homedown = new Image; homedown.src = "{T_THEME_PATH}/images/menu/portal_f2.png";

registerup = new Image; registerup.src = "{T_THEME_PATH}/images/menu/register.png";

registerdown = new Image; registerdown.src = "{T_THEME_PATH}/images/menu/register_f2.png";

thanksup = new Image; thanksup.src = "{T_THEME_PATH}/images/menu/gratitude.png";

thanksdown = new Image; thanksdown.src = "{T_THEME_PATH}/images/menu/gratitude_f2.png";

searchnavup = new Image; searchnavup.src = "{T_THEME_PATH}/images/menu/search.png";

searchnavdown = new Image; searchnavdown.src = "{T_THEME_PATH}/images/menu/search_f2.png";

memberlistup = new Image; memberlistup.src = "{T_THEME_PATH}/images/menu/members.png";

memberlistdown = new Image; memberlistdown.src = "{T_THEME_PATH}/images/menu/members_f2.png";

profileup = new Image; profileup.src = "{T_THEME_PATH}/images/menu/ucp.png";

profiledown = new Image; profiledown.src = "{T_THEME_PATH}/images/menu/ucp_f2.png";

pmup = new Image; pmup.src = "{T_THEME_PATH}/images/menu/inbox.png";

pmdown = new Image; pmdown.src = "{T_THEME_PATH}/images/menu/inbox_f2.png";

newup = new Image; newup.src = "{T_THEME_PATH}/images/menu/newpm.png";

newdown = new Image; newdown.src = "{T_THEME_PATH}/images/menu/newpm_f2.png";

loginup = new Image; loginup.src = "{T_THEME_PATH}/images/menu/login.png";

logindown = new Image; logindown.src = "{T_THEME_PATH}/images/menu/login_f2.png";

logoutup = new Image; logoutup.src = "{T_THEME_PATH}/images/menu/logout.png";

logoutdown = new Image; logoutdown.src = "{T_THEME_PATH}/images/menu/logout_f2.png";

restoreup = new Image; restoreup.src = "{T_THEME_PATH}/images/menu/restore.png";

restoredown = new Image; restoredown.src = "{T_THEME_PATH}/images/menu/restore_f2.png";

galleryup = new Image; galleryup.src = "{T_THEME_PATH}/images/menu/gallery.png";

gallerydown = new Image; gallerydown.src = "{T_THEME_PATH}/images/menu/gallery_f2.png";





function MouseOverRoutine(ButtonName)

{

if (ButtonName=="portal"){document.portal.src = portaldown.src;}

if (ButtonName=="home"){document.home.src = homedown.src;}

if (ButtonName=="register"){document.register.src = registerdown.src;}

if (ButtonName=="thanks"){document.thanks.src = thanksdown.src;}

if (ButtonName=="searchnav"){document. searchnav.src = searchnavdown.src;}

if (ButtonName=="memberlist"){document.memberlist.src = memberlistdown.src;}

if (ButtonName=="profile"){document.profile.src = profiledown.src;}

if (ButtonName=="pm"){document.pm.src = pmdown.src;}

if (ButtonName=="login"){document.login.src = logindown.src;}

if (ButtonName=="logout"){document.logout.src = logoutdown.src;}

if (ButtonName=="restore"){document.restore.src = restoredown.src;}

if (ButtonName=="gallery"){document.gallery.src = gallerydown.src;}

if (ButtonName=="new"){document.new.src = newdown.src;}

}





function MouseOutRoutine(ButtonName)

{

if (ButtonName=="portal"){document.portal.src = portalup.src;}

if (ButtonName=="home"){document.home.src = homeup.src;}

if (ButtonName=="register"){document.register.src = registerup.src;}

if (ButtonName=="thanks"){document.thanks.src = thanksup.src;}

if (ButtonName=="searchnav"){document.searchnav.src = searchnavup.src;}

if (ButtonName=="memberlist"){document.memberlist.src = memberlistup.src;}

if (ButtonName=="profile"){document.profile.src = profileup.src;}

if (ButtonName=="pm"){document.pm.src = pmup.src;}

if (ButtonName=="login"){document.login.src = loginup.src;}

if (ButtonName=="logout"){document.logout.src = logoutup.src;}

if (ButtonName=="restore"){document.restore.src = restoreup.src;}

if (ButtonName=="gallery"){document.gallery.src = galleryup.src;}

if (ButtonName=="new"){document.new.src = newup.src;}

}





//-->

</script>

 <script type="text/javascript" src="{T_TEMPLATE_PATH}/tooltip.js"></script>
</head>
<body class="{S_CONTENT_DIRECTION}">


<a name="top"></a>
<div id="wrap">
<div id="wrapheader">



	<div id="logodesc">
		<table width="100%" cellspacing="0">
<tr>
			<td><a href="http://www.url.com">{SITE_LOGO_IMG}</a></td>
			<td width="100%" align="center" style="display:none;"><h1>{SITENAME} &nbsp; {PAGE_TITLE}</h1></td>
			
		    
		  
<td>
<!-- IF SCRIPT_NAME eq 'index' and S_DISPLAY_SEARCH and not S_IN_SEARCH -->
        <div id="search-box">
            <form action="{U_SEARCH}" method="post" id="search">
            
                <input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
                <input class="button1" value="{L_SEARCH}" type="submit" /><br />
		    <input type="hidden" name="sr" value="topics" />
                
            </form>
        </div>
<!-- ENDIF -->

<!-- IF S_VIEWFORUM and S_DISPLAY_SEARCH and not S_IN_SEARCH -->
		<div id="search-box">
			<form method="post" id="forum-search" action="{S_SEARCHBOX_ACTION}">	
			
				<input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="22" value="{L_SEARCH_FORUM}" onclick="if (this.value == '{LA_SEARCH_FORUM}') this.value = '';" onblur="if (this.value == '') this.value = '{LA_SEARCH_FORUM}';" />
				<input class="button1" type="submit" value="{L_SEARCH}" />	
				<input type="hidden" value="{FORUM_ID}" name="fid[]" />
				<input type="hidden" name="sr" value="topics" />
			
			</form>
		</div>
<!-- ENDIF -->	  

<!-- IF S_VIEWTOPIC and S_DISPLAY_SEARCH and not S_IN_SEARCH -->
		<div id="search-box">
			<form method="post" id="topic-search" action="{S_SEARCHBOX_ACTION}">
			
				<input class="inputbox search tiny"  type="text" name="keywords" id="search_keywords" size="22" value="{L_SEARCH_TOPIC}" onclick="if(this.value=='{LA_SEARCH_TOPIC}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_TOPIC}';" />
				<input class="button1" type="submit" value="{L_SEARCH}" />
				<input type="hidden" value="{TOPIC_ID}" name="t" />
				<input type="hidden" value="msgonly" name="sf" />
			
			</form>
		</div>
<!-- ENDIF -->

<!-- IF SEARCH_IN_RESULTS and S_DISPLAY_SEARCH and not S_IN_SEARCH -->
		<div id="search-box">
			<form method="post" id="search" action="{S_SEARCH_ACTION}">
			
				<input class="inputbox search tiny" type="text" name="add_keywords" id="search_keywords" value="{L_SEARCH_IN_RESULTS}" size="23" onclick="if(this.value=='{L_SEARCH_IN_RESULTS}')this.value='';" onblur="if(this.value=='')this.value='{L_SEARCH_IN_RESULTS}';"/> 
				<input class="button1" type="submit" name="submit" value="{L_SEARCH}" />
			
			</form>
		</div>
</td>
</tr>
<!-- ENDIF -->

</table>
</div>

<!-- IF not $S_IN_PORTAL or not S_DISPLAY_MAINMENU -->
	<div class="menubar">
<table width="100%" border="0" height="25" align="center" cellpadding="0" cellspacing="0">
  <tr>
   <td class="headerlogo" height="25" align="center" valign="center" background="{T_THEME_PATH}/images/menu/nav_back.png">
            <a href="{U_PORTAL}" onmouseOver="MouseOverRoutine('home')" onmouseOut="MouseOutRoutine('home')"><img src="{T_THEME_PATH}/images/menu/portal.png" name="home" border="0"></a>
			
            <!-- IF U_RESTORE_PERMISSIONS --><a href="{U_RESTORE_PERMISSIONS}" onmouseover="MouseOverRoutine('restore')" onmouseOut="MouseOutRoutine('restore')"><img src="{T_THEME_PATH}/images/menu/restore.png" name="restore" border="0"></a><!-- ENDIF -->

            <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> <img src="{T_THEME_PATH}/images/menu/nav_disabled.gif" name="disabled" border="0" alt="Disabled"><!-- ENDIF -->

			<a href="{U_GALLERY_MOD}" onmouseOver="MouseOverRoutine('gallery')" onmouseOut="MouseOutRoutine('gallery')"><img src="{T_THEME_PATH}/images/menu/gallery.png" name="gallery" border="0"></a>

<!-- IF not S_IS_BOT -->
               <!-- IF S_USER_LOGGED_IN -->
                  <!-- IF S_DISPLAY_PM -->
                  <!-- IF S_NEW_PM || S_USER_NEW_PRIVMSG -->
                  <a href="{U_PRIVATEMSGS}" onmouseOver="MouseOverRoutine('new')" onmouseOut="MouseOutRoutine('new')"<img src="{T_THEME_PATH}/images/menu/newpm.png" name="new" border="0" alt="{PRIVATE_MESSAGE_INFO}"></a>
                  <!-- ELSEIF S_USER_UNREAD_PRIVMSG -->
                  <a href="{U_PRIVATEMSGS}" onmouseOver="MouseOverRoutine('pm')" onmouseOut="MouseOutRoutine('pm')"><img src="{T_THEME_PATH}/images/menu/inbox.png" name="pm" border="0" alt="{PRIVATE_MESSAGE_INFO}"></a>
                  <!-- ELSE -->
                  <a href="{U_PRIVATEMSGS}" onmouseOver="MouseOverRoutine('pm')" onmouseOut="MouseOutRoutine('pm')"><img src="{T_THEME_PATH}/images/menu/inbox.png" name="pm" border="0" alt="{PRIVATE_MESSAGE_INFO}"></a>
                  <!-- ENDIF -->
				  
				  <a href="{U_PROFILE}" onmouseOver="MouseOverRoutine('profile')" onmouseOut="MouseOutRoutine('profile')"><img src="{T_THEME_PATH}/images/menu/ucp.png" name="profile"border="0"></a>
                  
                  <!-- ENDIF -->
               <!-- ELSEIF S_REGISTER_ENABLED -->
			   <a href="{U_REGISTER}" onmouseOver="MouseOverRoutine('register')" onmouseOut="MouseOutRoutine('register')"><img src="{T_THEME_PATH}/images/menu/register.png" name="register" border="0"></a>
			   <!-- ENDIF -->
            <!-- ENDIF -->


            <!-- IF not S_IS_BOT -->
			<!-- IF S_USER_LOGGED_IN -->

            <a href="{U_MEMBERLIST}" onmouseOver="MouseOverRoutine('memberlist')" onmouseOut="MouseOutRoutine('memberlist')"><img src="{T_THEME_PATH}/images/menu/members.png" name="memberlist" border="0"></a>
			
			<a href="{U_THANKSLIST}" onmouseOver="MouseOverRoutine('thanks')" onmouseOut="MouseOutRoutine('thanks')"><img src="{T_THEME_PATH}/images/menu/gratitude.png" name="thanks" border="0"></a>

			<!-- ENDIF -->
            <!-- ENDIF -->
			
			<!-- IF S_DISPLAY_SEARCH --><a href="{U_SEARCH}" onmouseOver="MouseOverRoutine('searchnav')" onmouseOut="MouseOutRoutine('searchnav')"><img src="{T_THEME_PATH}/images/menu/search.png" name="searchnav" border="0"></a><!-- ENDIF -->

            <!-- IF not S_IS_BOT -->

               <!-- IF S_USER_LOGGED_IN -->

               <a href="{U_LOGIN_LOGOUT}" onmouseOver="MouseOverRoutine('logout')" onmouseOut="MouseOutRoutine('logout')"><img src="{T_THEME_PATH}/images/menu/logout.png" name="logout" border="0"></a>

               <!-- ELSE --><a href="{U_LOGIN_LOGOUT}" onmouseOver="MouseOverRoutine('login')" onmouseOut="MouseOutRoutine('login')"><img src="{T_THEME_PATH}/images/menu/login.png" name="login" border="0"></a>

               <!-- ENDIF -->

            <!-- ENDIF -->
</td>
  </tr>
</table>
  </div>
<!-- ENDIF -->

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21724
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: dynamic menu button problems

Post by Mick » Wed Oct 13, 2010 11:56 am

Where did you get the script from or what was the source of the script, is there anything in the information relating to IE & Chrome?
"The more connected we get the more alone we become" - Kyle Broflovski

Locked

Return to “[3.0.x] MOD Writers Discussion”