Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
preloading images prevents my popup menus from working
Old 01-22-2007, 07:24 PM preloading images prevents my popup menus from working
Junior Talker

Posts: 2
Trades: 0
I am new to java, but am learning fast. I inherited a site with css and java already in it. My index page has popup menus that pop out to the right, they used to work (I have an older save of index to test), but they

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>

<body onload="MM_preloadImages('images/splash_nav_r1_c4_f3.jpg', 'images/splash_nav_r1_c4_f2.jpg', 'images/splash_nav_r1_c4_f4.jpg', 'images/splash_nav_r3_c1_f3.jpg', 'images/splash_nav_r3_c1_f2.jpg', 'images/splash_nav_r3_c1_f4.jpg', 'images/splash_nav_r3_c3_f3.jpg', 'images/splash_nav_r3_c3_f2.jpg', 'images/splash_nav_r3_c3_f4.jpg', 'images/splash_nav_r3_c5_f3.jpg', 'images/splash_nav_r3_c5_f2.jpg', 'images/splash_nav_r3_c5_f4.jpg', 'images/splash_nav_r3_c8_f3.jpg', 'images/splash_nav_r3_c7_f2.jpg', 'images/splash_nav_r3_c7_f4.jpg', 'images/splash_nav_r3_c9_f3.jpg', 'images/splash_nav_r3_c9_f2.jpg', 'images/splash_nav_r3_c9_f4.jpg', 'images/splash_nav_r5_c1_f3.jpg', 'images/splash_nav_r5_c1_f2.jpg', 'images/splash_nav_r5_c1_f4.jpg', 'images/splash_nav_r5_c3_f3.jpg', 'images/splash_nav_r5_c3_f2.jpg', 'images/splash_nav_r5_c3_f4.jpg', 'images/splash_nav_r5_c5_f3.jpg', 'images/splash_nav_r5_c5_f2.jpg', 'images/splash_nav_r5_c5_f4.jpg', 'images/splash_nav_r7_c5_f3.jpg', 'images/splash_nav_r7_c5_f2.jpg', 'images/splash_nav_r7_c5_f4.jpg', 'images/splash_nav_r5_c7_f3.jpg', 'images/splash_nav_r5_c7_f2.jpg', 'images/splash_nav_r5_c7_f4.jpg')">



The page I am working on ishttp://www.nmprc.state.nm.us. The popout menus sort of work in IE7, but when the mouse goes over one of the images behind the menu, the menu disappears.
I have no absolute values in my css.

the menu list items use this code from the css


ul {
margin: 0;
padding: 0;
list-style: none;
width: 160px; /* Width of Menu Items */
border-bottom: 1px solid #CBA;
}
ul li {
position: relative;
}

li ul {
position: absolute;
left: 159px; /* Set 1px less than menu width */
top: 0;
display: none;
}
/* Styles for Menu Items */
ul li a {
display: block;
text-decoration: none;
padding: 4px;
border: 1px solid #CBA;
border-bottom: 0;
background-color: #F9F9F9;
}
/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; height: 1%; }
* html ul li a {
height: 1%;
}
/* End */
ul li a:hover {
color: #f9f9f9;
background-color: #660000;
} /* Hover Styles */

li ul li a { padding: 2px; } /* Sub Menu Styles */

li:hover ul, li.over ul { display: block; } /* The magic */



any ideas?
don't now. Well they work in Firefox, and sort of in IE7, but not in IE6 at all. I have narrowed it down to the script below which preloads the images that make up the index page. If I take out the preloading of the images, the menus work, but with this in they don't.

Last edited by mgraphic; 01-23-2007 at 12:50 AM.. Reason: Post breaking
deguero is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-22-2007, 07:45 PM Re: preloading images prevents my popup menus from working
Junior Talker

Posts: 2
Trades: 0
actually after reading my own post, I don't think I made my problem clear
what I need is a way to make the menu items take priority over the images,
when right now the images seem to take over the page with a mouse over.

I can provide more code if needed, its just that i know what needs to happen, I
just don't know how to make it happen
deguero is offline
Reply With Quote
View Public Profile
 
Old 01-25-2007, 06:17 AM Re: preloading images prevents my popup menus from working
saadatshah's Avatar
Extreme Talker

Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Trades: 0
provide code, send a url with code files
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Reply     « Reply to preloading images prevents my popup menus from working
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33070 seconds with 12 queries