script wont work in IE

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
micsta
Registered User
Posts: 126
Joined: Tue Apr 22, 2008 11:11 am

script wont work in IE

Post by micsta » Wed Aug 04, 2010 7:24 am

I have put a little script in the header of my forum. When viewing with FF, everything works (the menu image changes when using onmouseover). With IE however, the onmouseover image is not displayed so the menu is static.

Any reason why this would be happening?

Code: Select all

<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>






<!-- 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
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: script wont work in IE

Post by ric323 » Wed Aug 04, 2010 9:30 am

Is this present on your board right now?
It's always easier to actually try the code in place.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

micsta
Registered User
Posts: 126
Joined: Tue Apr 22, 2008 11:11 am

Re: script wont work in IE

Post by micsta » Wed Aug 04, 2010 11:09 am

Yeh, they are snippets from my overall_header.html. It's running now and working fine with Firefox, but with IE the onmouseover image wont show when hovering the cursor on the menu.

User avatar
AmigoJack
Registered User
Posts: 5657
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: script wont work in IE

Post by AmigoJack » Wed Aug 04, 2010 11:38 am

Give us a link to your board, so we see it in action.
My first shot is that you need to do new Image() instead of new Image only, but I'm not sure.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

Locked

Return to “[3.0.x] Support Forum”