53 users online (0 members and 53 guests)  


Page 1 of 2 1 2 Last
  Results 1 to 15 of 17

Related

  1. close window    Forum: Javascript Forum
    Replies: 0
  2. close window    Forum: Javascript Forum
    Replies: 3
  3. Replies: 1
  1. #1
    Codyg's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Mass
    Posts
    11

    how to close or remove a frame

    Hi, kinda stumped here guys. I have a lframe (left frame) and index (main frame, right frame) I want to have the option to dump the left frame whenever I shose. How can I do that?

    So far I have been able to find this script but it doesn't seem to work.


    <a href="javascript:self.location.href=window.lframe.html.location.href">Remove frame</a><BR>

    and / or

    <a href="window.lframe.location.href" target=_top> Remove frame</a><BR>

    ..one more thing, why are all the images missing on this page?

    dgonline@comcast.net

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there Codyg,

    Here is one way to remove an iframe from your page...
    Code:
    <html>
    <head>
    <title>Remove Iframe</title>
    <style type="text/css">
    /*<![CDATA[*/
    
    #theiframe {
        position:absolute;
        top:100px;
        width:324px;
        height:200px;
     }
     /*//]]>*/
    </style>
    </head>
    <body>
    
    <iframe id="theiframe" src="http://www.google.com/"></iframe>
    
    <div><a href="#"onclick="document.getElementById('theiframe').style.display='none'">Remove Frame</a></div>
    <div><a href="#"onclick="document.getElementById('theiframe').style.display='block'">Replace Frame</a></div>
    
    </body>
    </html>
    As to your second question...

    quote:
    'one more thing, why are all the images missing on this page?'


    ...well, this has really got me stumped also
    Not only can I not see any images but also I cannot find...

    'this page'


    coothead

  3. #3
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    The images are working here, no I am not calling from my HD

    Is it just this page or are all images missing from every page?

    Dave

  4. #4
    Codyg's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Mass
    Posts
    11

    not I frame, Left Frame = Lframe

    Thanks, but I wasn't looking for an Iframe answer. That was actually an L, for Left frame (lframe) Sorry, I must not have been clear.

    This is the site, very simple frameeset http://dgonline.home.comcast.net/frame1.html just want to have a link in the left frame/menu so I can remove it when I chose.
    Last edited by Codyg; 05-03-2004 at 11:27 PM. Reason: clarify

  5. #5
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    If you want to have certain links appear in a full window when clicked just use target=_top in your link.

    Dave

  6. #6
    Codyg's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Mass
    Posts
    11
    I'm back. Thanks Dave but the reason I want to know how to do this is so when I link to another site I can browse around in my right frame while keeping my left frame menu open and accessible. I see it all over the place and when I want the option to get out of the frameset from my site I would like to have that option available. I can't seem to make it work, I am also pretty sure it's my fault. Everythign else I have fought with I have been able to make work accept this.

    I just don't get it. <a href="javascript:top.location.href=bottom.location.href">Remove
    frame</a><br>

    for example, google uses a class link I htink to make the page show up as the link, this is the page and hwere I got the idea in the first place. http://images.google.com/imgres?imgurl=www.simpletractors.com/images/hydraulics/figure2.jpg&imgrefurl=http://www.simpletractors.com/operation/hydraulics/hydraulic_lift.htm&h=404&w=800&sz=33&tbnid=_I6miz9osLUJ:&tbnh=71&tbnw=140&start=8&prev=/images%3Fq%3Dremove%2Bframe%26hl%3Den%26lr%3D%26ie%3DUTF-8%26sa%3DG
    Last edited by Codyg; 06-02-2004 at 11:07 PM.

  7. #7
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    I think this page may be of help
    http://www.java-scripts.net/scripts.phtml?sid=39

    Dave

  8. #8
    Codyg's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Mass
    Posts
    11

    Cool

    I can't imagine how many hours it took for you to find the information you get, that is a great tool. Now can I push? Is it possible to target the other frame? so if I get to a site, I can remove the other frame?

    So if I am in my frames pages, I link over here for example, and I want to get rid of my frame and just view this page... is that possible? What I do now is when I find a page that I want to view alone, I go back one page and click "open link in new window" This way I can book mark that page. See what I am saying?

    Sorry man, I think I am in over my head, this is just a hobby. I will look around at the site you directed me too as well, thanks again.
    Last edited by Codyg; 06-04-2004 at 10:26 AM.

  9. #9
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    simply add the target="_top" attribute to your link

    HTML Code:
    <a href="http://www.ahfb2000.com" target="_top">Advanced HTML For Beginners</a>
    Dave

  10. #10
    Codyg's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Mass
    Posts
    11
    Thansk again, but I am looking for an automated solution. I think I might just let it rest for now. I cna't understand what Google used because I think it is server side and behind the scenes.

    Thanks again.

  11. #11
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Here is googles code
    HTML Code:
    <a class=nu href="http://www.simpletractors.com/operation/hydraulics/hydraulic_lift.htm" target=_top>
    look familiar?

    Dave

  12. #12
    Codyg's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Mass
    Posts
    11
    lol... yeah, I saw that already, I looked at the source, the question is how do they get the page link in there for each site that you go to? I thought that the "class" may have been to a script to something that puts the link in there. See, man dont' waste your time with me,,,, You do understand what Iam talkign about though right? Am I over looking the obvious?

  13. #13
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    The class is just for CSS. It is inserted dynamically through a script, I am extremely limited in writing scripts.

    Dave

  14. #14
    impact2010's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2010
    Posts
    1

    Re: how to close or remove a frame

    Hi all,

    Been making a living online for three years now getting advice from forums and this is the first time I have been able to give anyrthing back.

    Closing a frameset from one of the source frames:

    In the source frame that will act as the 'closer' put this between the <head> tags:

    <SCRIPT>
    <!--
    if(top.location.href!=self.location.href)
    document.writeln('<A HREF="'+self.location.href+'" TARGET="_top">Close this page</A>');
    window.close();
    //-->
    </SCRIPT>

    Hope that helps!

  15. #15
    Codyg's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Mass
    Posts
    11

    Re: how to close or remove a frame

    Thank you all for getting back to me.
    ===============
    tried this but I am thinking that I am STILL missing something.

    <SCRIPT>
    <!--
    if(top.location.href!=self.location.href)
    document.writeln('<A HREF="'+self.location.href+'" TARGET="_top">Break the frames!</A>');
    //-->
    </SCRIPT>

    am I supose to change anything in this code i.e. page name?
    ==================================
    tried this but am still not understanding as my scripting is limited - very!

    <SCRIPT>
    <!--
    if(top.location.href!=self.location.href)
    document.writeln('<A HREF="'+self.location.href+'" TARGET="_top">Close this page</A>'); window.close(); //--> </SCRIPT>

    --- when I put this in the head tag, what would I put in the body as a close link? do I need to change any page names? ----
    ==================================
    <a href="javascript:self.location.href=window.lframe.html.location.href">Remove frame</a><BR>

    This is the other method and I am thinkign that I need to change something here. - name I used is LFRAME.html which is the frame that I want to close. (lframe vs rframe)

    I actually gave up on this idea a while ago and received an email today that there was a response so I am going to try again, so far I have had no luck.

    If you can, let me know what I am missing and I will keep looking.

    Thanks



Page 1 of 2 1 2 Last

Tags for this Thread