1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

close iframe from within that iframe

Discussion in 'JavaScript' started by chrisjongkind, Dec 1, 2007.

  1. Psychotomus1

    Psychotomus1 Banned

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #21
    How could you hide all i-frames loaded upon loading a page?
     
    Psychotomus1, Dec 11, 2007 IP
  2. hrcerqueira

    hrcerqueira Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #22
    
    var iframes = document.getElementsByTagName('IFRAME');
    
    for (var i = 0; i < iframes.length; i++) {
       iframes[i].style.display = 'none';
    }
    
    Code (markup):
     
    hrcerqueira, Dec 12, 2007 IP
  3. godkillah

    godkillah Guest

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #23
    <script>
    if(location.href!=top.location.href){
    top.location.href
    }
    </script>
    Code (markup):
    this will basically redirect the page iframing your site to your site,
     
    godkillah, Dec 16, 2007 IP
  4. diegot

    diegot Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #24
    Hello! Are you still there? I have a slightly different need. This is where my site is being built:
    http://www.miramarinteractivo.com.ar/
    At the bottom of the page there is a gallery that scrolls on mouse over, where I want to put adds, so far only the fake google ones. I want to replace each one of these adds with an iframe, each with a close button for the individual frame, so visitors can close an add and the next one would slide to fill in the empty space or, at least, reload the whole gallery with its new configuration that excludes the closed frame. I've seen many scripts that create and then close pop ups and iframes with javascript but my frames are not dinamically created: they appear on page load. Other scripts use absolute positioned div elements that are toogled visible or hidden, but apparently these won't allow the frames to be repositioned after an iframe is closed. What I want to do is similar to facebook's suggestion boxes and so far I couldn't find a way to make this work. Any suggestions please?
     
    diegot, Oct 7, 2010 IP