Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-19-2008, 06:01 AM   PM User | #1
m_sundar
New to the CF scene

 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
m_sundar is an unknown quantity at this point
Unhappy How to add mouseover event for parent page from iframe

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;
}
}

Last edited by m_sundar; 08-19-2008 at 07:38 AM.. Reason: Title was meaningless
m_sundar is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 06:05 AM.


Advertisement
Log in to turn off these ads.