Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •