saleemkhan
asked on
Problem with creating image resources
hai experts,
i have the html code to change the button color onmouseover event and onmouseoutevent.
so i create one imageresource and placed it on a page and for the image i put onmouseover and onmouseoutevent code.but i am not the same effect.
when the paste whole html code on page and passthru html its working fine.
i think i done very small mistake but unable to debug it out.can anybody will help me.
<style type="text/css">
A.1 {text-decoration:none}
</style>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x= a[i])&&x.o Src;i++) x.src=x.oSrc;
}
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_pre loadImages .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) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p arent.fram es.length) {
d=parent.frames[n.substrin g(p+1)].do cument; 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.len gth;i++) x=MM_findObj(n,d.layers[i] .document) ; return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+= 3)
if ((x=MM_findObj(a[i]))!=nul l){documen t.MM_sr[j+ +]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor="FFFFFF" topmargin="5" leftmargin="0" onLoad="MM_preloadImages(' images/ema ily.gif',' images/dis cussionsy. gif','imag es/formsy. gif','imag es/f&d y.gif','im ages/calen dary.gif', 'images/hr y.gif')">
<table border="0" cellspacing="0" cellpadding="0" width="800" height="530" align="left">
<tr align="center" valign="bottom">
<td colspan="3" height="20">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x= a[i])&&x.o Src;i++) x.src=x.oSrc;
}
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_pre loadImages .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) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p arent.fram es.length) {
d=parent.frames[n.substrin g(p+1)].do cument; 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.len gth;i++) x=MM_findObj(n,d.layers[i] .document) ; return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+= 3)
if ((x=MM_findObj(a[i]))!=nul l){documen t.MM_sr[j+ +]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages(' images/goa .gif')">
<table width="930" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" height="50" width="148"><img src="images/logo1.gif" width="150" height="50"></td>
<td width="631" height="25"> </td>
<td rowspan="2" width="151" height="50"><img src="images/test.gif" width="150" height="50"></td>
</tr>
<tr>
<td width="631" height="29" bgcolor="3366CC">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7%"> </td>
<td width="82%" align="center" valign="middle"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Search
<input type="text" name="textfield" size="30">
<a href="#" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Go','','i mages/goa. gif',1)">< img name="Go" border="0" src="images/gob.gif" width="18" height="17" align="bottom"></a></font> </td>
<td width="11%"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="bottom" align="left" width="130" height="20" bgcolor="FFFFFF">
<table cellpadding="0" cellspacing="0" border="0" width="130">
<tr align="center" valign="bottom" bgcolor="FFFFFF">
<td height="22" width="130"><img src="images/main.gif" width="145" height="22"></td>
</tr>
</table>
</td>
<td rowspan="2" width="670" valign="top" align="left" height="40">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x= a[i])&&x.o Src;i++) x.src=x.oSrc;
}
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_pre loadImages .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) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p arent.fram es.length) {
d=parent.frames[n.substrin g(p+1)].do cument; 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.len gth;i++) x=MM_findObj(n,d.layers[i] .document) ; return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+= 3)
if ((x=MM_findObj(a[i]))!=nul l){documen t.MM_sr[j+ +]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages(' images/log outy.gif') ">
<table width="670" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle" rowspan="2">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="634" bgcolor="FFFFFF" align="center" height="10"><font color="3366CC" size="3" face="Arial, Helvetica, sans-serif"><b><font size="2">Welcome
<font color="#000066">Shaik Hidayatulla</font></font>< /b>
</font></td>
<td align="right" valign="bottom" width="146" bgcolor="#FFFFFF"><font color="3366CC" size="3" face="Arial, Helvetica, sans-serif"><a href="logout.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'logout',' ','images/ logouty.gi f',1)"><im g name="logout" border="0" src="images/logoutb.gif" width="145" height="22"></a></font></t d>
</tr>
<tr bgcolor="#3366CC">
<td width="634" align="center" height="10" valign="top"> </td>
<td align="right" valign="bottom" width="146"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="bottom" align="left" width="130" height="20" bgcolor="3366CC"> </t d>
</tr>
<tr>
<td bgcolor="3366CC" align="left" valign="top" height="430" width="130">
<table width="130" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a onclick="return false;" href="mail.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Email','' ,'images/e maily.gif' ,1)"><img name="Email" border="0" src="images/emailb.gif" width="145" height="22" alt="Under Constraction"></a></td>
</tr>
<tr>
<td><a onclick="return false;" href="calendar.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Calendar' ,'','image s/calendar y.gif',1)" ><img name="Calendar" border="0" src="images/calendarb.gif" width="145" height="22" alt="Under Constraction"></a></td>
</tr>
<tr>
<td><a onclick="return false;" href="Discussions.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Discussio ns','','im ages/discu ssionsy.gi f',1)"><im g name="Discussions" border="0" src="images/discussionsb.g if" width="145" height="22" alt="Under Constraction"></a></td>
</tr>
<tr>
<td><a href="req.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Forms','' ,'images/f ormsy.gif' ,1)"><img name="Forms" border="0" src="images/formsb.gif" width="145" height="22"></a></td>
</tr>
<tr>
<td><a onclick="return false;" href="hr.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'HRResourc se','','im ages/hry.g if',1)"><i mg name="HRResourcse" border="0" src="images/hrb.gif" width="145" height="22" alt="Under Constraction"></a></td>
</tr>
<tr align="left">
<td><a href="Files.cfm" onMouseOut="MM_swapImgRest ore()" onMouseOver="MM_swapImage( 'Files','' ,'images/f &dy.gif',1 )"><img name="Files" border="0" src="images/f&d.gif" width="145" height="22"></a></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
<td valign="top" width="670" height="420">
</td>
</tr>
<tr align="center" valign="top" bordercolor="White" bordercolordark="White">
<td colspan="3" height="40" bordercolor="White" bordercolor="White">
<table width="930" cellpadding="0" cellspacing="0">
<tr bgcolor="FFCC00">
<td width="130" rowspan="2" height="20"> </td>
<td height="20" rowspan="2"><div align="center"><font color="#3366CC" size="1" face="Arial, Helvetica, sans-serif"></font></div>< /td>
<td width="150" height="20" rowspan="2"> </td>
</tr>
<tr bgcolor="FFCC00">
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
i have the html code to change the button color onmouseover event and onmouseoutevent.
so i create one imageresource and placed it on a page and for the image i put onmouseover and onmouseoutevent code.but i am not the same effect.
when the paste whole html code on page and passthru html its working fine.
i think i done very small mistake but unable to debug it out.can anybody will help me.
<style type="text/css">
A.1 {text-decoration:none}
</style>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=
}
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_pre
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p
d=parent.frames[n.substrin
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
for(i=0;!x&&d.layers&&i<d.
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
if ((x=MM_findObj(a[i]))!=nul
}
//-->
</script>
</head>
<body bgcolor="FFFFFF" topmargin="5" leftmargin="0" onLoad="MM_preloadImages('
<table border="0" cellspacing="0" cellpadding="0" width="800" height="530" align="left">
<tr align="center" valign="bottom">
<td colspan="3" height="20">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=
}
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_pre
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p
d=parent.frames[n.substrin
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
for(i=0;!x&&d.layers&&i<d.
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
if ((x=MM_findObj(a[i]))!=nul
}
//-->
</script>
<body onLoad="MM_preloadImages('
<table width="930" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" height="50" width="148"><img src="images/logo1.gif" width="150" height="50"></td>
<td width="631" height="25"> </td>
<td rowspan="2" width="151" height="50"><img src="images/test.gif" width="150" height="50"></td>
</tr>
<tr>
<td width="631" height="29" bgcolor="3366CC">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7%"> </td>
<td width="82%" align="center" valign="middle"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Search
<input type="text" name="textfield" size="30">
<a href="#" onMouseOut="MM_swapImgRest
<td width="11%"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="bottom" align="left" width="130" height="20" bgcolor="FFFFFF">
<table cellpadding="0" cellspacing="0" border="0" width="130">
<tr align="center" valign="bottom" bgcolor="FFFFFF">
<td height="22" width="130"><img src="images/main.gif" width="145" height="22"></td>
</tr>
</table>
</td>
<td rowspan="2" width="670" valign="top" align="left" height="40">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=
}
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_pre
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p
d=parent.frames[n.substrin
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
for(i=0;!x&&d.layers&&i<d.
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
if ((x=MM_findObj(a[i]))!=nul
}
//-->
</script>
<body onLoad="MM_preloadImages('
<table width="670" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle" rowspan="2">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="634" bgcolor="FFFFFF" align="center" height="10"><font color="3366CC" size="3" face="Arial, Helvetica, sans-serif"><b><font size="2">Welcome
<font color="#000066">Shaik Hidayatulla</font></font><
</font></td>
<td align="right" valign="bottom" width="146" bgcolor="#FFFFFF"><font color="3366CC" size="3" face="Arial, Helvetica, sans-serif"><a href="logout.cfm" onMouseOut="MM_swapImgRest
</tr>
<tr bgcolor="#3366CC">
<td width="634" align="center" height="10" valign="top"> </td>
<td align="right" valign="bottom" width="146"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="bottom" align="left" width="130" height="20" bgcolor="3366CC"> </t
</tr>
<tr>
<td bgcolor="3366CC" align="left" valign="top" height="430" width="130">
<table width="130" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a onclick="return false;" href="mail.cfm" onMouseOut="MM_swapImgRest
</tr>
<tr>
<td><a onclick="return false;" href="calendar.cfm" onMouseOut="MM_swapImgRest
</tr>
<tr>
<td><a onclick="return false;" href="Discussions.cfm" onMouseOut="MM_swapImgRest
</tr>
<tr>
<td><a href="req.cfm" onMouseOut="MM_swapImgRest
</tr>
<tr>
<td><a onclick="return false;" href="hr.cfm" onMouseOut="MM_swapImgRest
</tr>
<tr align="left">
<td><a href="Files.cfm" onMouseOut="MM_swapImgRest
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
<td valign="top" width="670" height="420">
</td>
</tr>
<tr align="center" valign="top" bordercolor="White" bordercolordark="White">
<td colspan="3" height="40" bordercolor="White" bordercolor="White">
<table width="930" cellpadding="0" cellspacing="0">
<tr bgcolor="FFCC00">
<td width="130" rowspan="2" height="20"> </td>
<td height="20" rowspan="2"><div align="center"><font color="#3366CC" size="1" face="Arial, Helvetica, sans-serif"></font></div><
<td width="150" height="20" rowspan="2"> </td>
</tr>
<tr bgcolor="FFCC00">
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The white background is due to a bug in notes. To bypass this problem, create the images with a background colour the same as the background colour of the page you want to put them on.
I won't be able to create the images for you today, but I'll make sure you get them tomorrow morning.
I won't be able to create the images for you today, but I'll make sure you get them tomorrow morning.
ASKER
Excellent its working fine what i did is while creating the button itself i gave background as blue color.
thank u very much for ur hint.
i need the same help in future also.
saleem.
ASKER
why its appearing white background color for the button when i change the background color of the page to blue.
waiting for reply.
saleem.