Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

swaping menu images

Status
Not open for further replies.

wolf73

Programmer
Feb 12, 2006
93
CA
I keep geting this error, object not found. I am tryig to swap images on mouse over event, my onclick works fine.







<script language='javascript'>


function MM_swapImgRestore() { //v3.0
//var i,x,a=document.MM_sr; for(i=0;a&amp;&amp;i&lt;a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))&gt;0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i&lt;d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i&lt;d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x &amp;&amp; d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
// var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i&lt;(a.length-2);i+=3)
//if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

</script>
<script language='javascript'>

function winBRopen(theURL, Name, popW, popH, scroll) { // V 1.0


var winleft = (screen.width - popW) / 2;
var winUp = (screen.height - popH) / 2;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
Win = window.open(theURL, Name, winProp)
if (parseInt(navigator.appVersion) == 4) { Win.window.focus(); }

}
// winBRopen END --&gt;


</script>





<td><a href='#' onmouseover="MM_swapImage('how1','','images/button_how.gif',1)" onmouseout="MM_swapImgRestore()" onclick="winBRopen('how.htm','About','617','390','Yes');return false;"><img name='how1' src='images/button_how_over.gif' id='how1' border='0' height='23' width='103'/></a></td>
 
I tried visiting that website and I get the same error. I'm not sure if it has anything to do with your code. Is .dev a vaild website extension? (i.e. .com, .net, .org)
 
.dev certainly isn't a TLD that I'm aware of.....



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
So you think error is coming becuse of the domain (dev). This website is on the local test server...
 
It's a 99% certainty that the domain name has no bearing on the problem in this case.

Perhaps ttimf is confusing the "Object not found" JavaScript error with a "Page not found" browser error?

Anyway - Is the "Object not found" error definately for the onmouseover? Or is it for the onmouseout? Perhaps you could try running the code in Firefox and look at the JavaScript console there. Its error messages are usually far more helpful than those from IE.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top