Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:50
Preload menu image back / sample needed ...
Poster: BTC
Dated: Tuesday March 15 2005 - 20:21:04 GMT
Hi awhile ago I wrote here and since lost where it went,
However, we have a center justified website and using the menu code at top of page right after /head to call up additional menu files/info.
QA? It was suggested that since menu images (as compressed as they are, be preloaded) using a files we were givin from here called: preloadmenuimages.js
1 - We regret we not 100% sure where or what code (conext) to use.
2 - Within the preloadmenuimages.js file, how (context) do we preload the image(s) ..
Actual sample needed.
- THANKS : Michael (http://www.JungleHouse.com)
---------------------------------------------------------
FYI, here is our supporting for each:
#1: [[ DO WE ADD line to call preload.js within here? ]]
<!-- ==MENU== -->
<SCRIPT language=JavaScript src="menusrc.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=menuprog.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=menudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu.js" type=text/javascript></SCRIPT>
<!-- ==MENU== -->
#2: [[ The preload.js text / what would a line to preload image look like? ]]
/*
Milonic DHTML Menu Image Pre-loading Module preloadmenuimages.js version 1.0
This module is only compatible with the Milonic DHTML Menu version 5.16 or higher
Copyright 2004 (c) Milonic Solutions Limited. All Rights Reserved.
This is a commercial software product, please visit http://www.milonic.com/ for more information.
USE: This module does not need any parameters but needs to be placed after the menus have been built
SYNTAX: <script language="JavaScript1.2" type="text/javascript" src="preloadmenuimages.js"></script>
*/
_mIms=new Array();
function _mPLF(_img)
{
for(_x=0;_x<_mIms.length;_x++)
{
if(_img==_mIms[_x])return
_x++
}
_mIms[_mIms.length]=_img
_mIms[_mIms.length]=new Image()
_mIms[_mIms.length-1].src=_img
}
function mmenuPreLoadImages()
{
for(_i=0;_i<_mi.length;_i++)
{
_I=_mi[_i]
if(_I[24])_mPLF(_I[24])
if(_I[29])_mPLF(_I[29])
if(_I[32])_mPLF(_I[32])
if(_I[46])_mPLF(_I[46])
if(_I[47])_mPLF(_I[47])
if(_I[48])_mPLF(_I[48])
if(_I[56])_mPLF(_I[56])
if(_I[69])_mPLF(_I[69])
if(_I[71])_mPLF(_I[71])
if(_I[73])_mPLF(_I[73])
}
}
mmenuPreLoadImages()
Poster: Ruth
Dated: Tuesday March 15 2005 - 20:47:31 GMT
It gets loaded after the menu_data.js file
Code:
<SCRIPT language=JavaScript src="menusrc.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=menuprog.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=menudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript src="preloadmenuimages.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=menuprog.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=menudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript src="preloadmenuimages.js" type=text/javascript></SCRIPT>
You don't need to put anything into the module if that's what you are asking. You just have to make sure it is called after the menu_data.js file is called. The preloadmenuimages.js file works with the program, it reads the images from that.
Ruth