...

View Full Version : How to add mouseover event for parent page from iframe



m_sundar
08-19-2008, 06:01 AM
Hi,

I am using a .aspx page with an iframe inside it.

I have two buttons in the .aspx page with mouseover and mouseout events lets say Button1 and Button2. When this page loads the mouseover and mouseout events for Button1 are added in the server side using attributes.add.
Button2 does not have any attributes.

Similarly i have a button in the page that i have displayed in the iframe lets say that as 'Cancel Button'. When i click on this cancel button i need to add the mouseover and mouseout events for Button2 in the parent page and remove the attributes added for Button1 in the parent page.

I am able to do this in Firefox but i am not able to do this in IE. Can anyone help me out with this , thnx...

Script that is use
-----------------
function sam()
{
var newTktBtn = window.parent.document.getElementById('ctl00_CallNASAContents_btnNewTicket');
if(newTktBtn.attachEvent)
{
var lst15Btn = window.parent.document.getElementById('ctl00_CallNASAContents_btnLast15');
lst15Btn.style.backgroundImage = 'url(../NasaImages/subNav_Over.gif)';
lst15Btn.style.color = 'Black';
lst15Btn.onmouseover = null;
lst15Btn.onmouseout = null;
newTktBtn.style.backgroundImage = 'url(../NasaImages/newTkt_Out.gif)';
newTktBtn.style.color = 'White';
newTktBtn.attachEvent('onmouseover',function(){bc()});
}

if(window.addEventListener)
{
var lst15Btn = window.parent.document.getElementById('ctl00_CallNASAContents_btnLast15');
lst15Btn.style.backgroundImage = 'url(../NasaImages/subNav_Over.gif)';
lst15Btn.style.color = 'Black';
lst15Btn.onmouseover = null;
lst15Btn.onmouseout = null;
newTktBtn.style.backgroundImage = 'url(../NasaImages/newTkt_Out.gif)';
newTktBtn.style.color = 'White';
newTktBtn.onmouseover = MouseOv;
newTktBtn.onmouseout = MouseOu;
}
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum