Results 1 to 2 of 2

Thread: Swap image to another frame

  1. #1
    Join Date
    Aug 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Swap image to another frame

    I did a search and couldnt find anything within the first few pages.

    What i want to do it have a nav with a simple 2image rollover (easy) but then as i roll over the nav i want an image to pop up in another frameset i.e main content. Then roll to another nav button and the image change again.

    All the while allowing once the nav is pressed to go to another page which will target to framest maincontent.

    does anyone have any info on this PLEASE?

    link im working on. mmgrates.isoars.com

    is made up of 4 different framesets.

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    http://developer.mozilla.org/en/DOM/window.parent http://msdn.microsoft.com/en-us/libr...26(VS.85).aspx
    http://developer.mozilla.org/en/DOM/window.top http://msdn.microsoft.com/en-us/libr...87(VS.85).aspx

    Without a framed page's permission, you can only access the frame - not the page itself. Therefore...

    in main_content.html:
    Code:
    window.parent.main = window;
    
    function swap(img){ // or whatever you want to call it
        // Do your thing here.
    }
    in left_nav.html:
    Code:
    window.onload = function(){
        var images = document.getElementsByName('nav');
        for(var i = 0; i < images.length; i++){
            images[i].onmouseover = mouseover;
        }
        function mouseover(){
            window.parent.main.swap(this); // or whatever you call it
        }
    };
    Last edited by Jesdisciple; 10-15-2008 at 06:11 AM.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

Bookmarks

Posting Permissions

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