Advanced Search

Results 1 to 7 of 7

Thread: Sticky Note iFrame question!

  1. #1
    Join Date
    Jun 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sticky Note iFrame question!

    1) Script Title: Sticky Note

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...stickynote.htm

    3) Describe problem: I'm using an iframe for this script and I still need the "close" button to function. The "close" function doesn't seem to work since the iframe is an external page...

    Is there any way I can still get the Sticky Note to close (without using a timer...)? Do I have to keep part of the original Sticky Note showing to the user (as in...not make the iframe take up the WHOLE sticky note...)?

    Thanks in advance!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    It's not clear to me what the issue is. You can (if the pages are both on the same domain) communicate via javascript between a page in an iframe and its parent page.

    From what I can tell, you want to close the sticky from the iframe displaying within it. If that's the case, this should work:

    Code:
    <a href="#" onclick="parent.hidefadebox();return false">Hide Box</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    It's not clear to me what the issue is. You can (if the pages are both on the same domain) communicate via javascript between a page in an iframe and its parent page.

    From what I can tell, you want to close the sticky from the iframe displaying within it. If that's the case, this should work:

    Code:
    <a href="#" onclick="parent.hidefadebox();return false">Hide Box</a>
    I'll try to explain it a bit better here...

    I would like to put up a mailing list sign-up inside the Sticky Note. So, when a person comes to my site, I would like the popup to have two input boxes (one for the name, and one for the e-mail)...then after they enter their information, I would like a "Thank you for signing up for my mailing list" page to pop up INSIDE Sticky Note after.

    I need a functional close button in both the initial sign-up page and the "Thank you" page. Is this possible? Sounds pretty tough to me and I can't figure it out...

    THIS IS ANOTHER IDEA I HAD...

    I don't mind if another window pops up in front of the original page as long as the Sticky Note closes... so if they sign up for my mailing list, the popup closes WHILE the COMPLETELY external "thank you" page opens...

    I hope this clears it up for you!

  4. #4
    Join Date
    Jun 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Maybe this will help...and NO I'm not trying to promote anything...the page isn't even functional yet! http://www.onlinepickupsecrets.com

    So yes, I would like the users to input their information, then have a thank you page come up after inside the StickyNote...I need the close button to be active and functional on BOTH pages.

    I've been trying to use iframes (but they're VERY ugly...)...but I would love it if I could get some help!

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    I thought you already had the iframe and just wanted a method of closing the sticky. I answered that question. I'm still not sure if you are asking anything more. I can tell you that AJAX may be able to be employed if you have PHP or asp or something like that and your server allows posting with an async request, you could post to fetched content. Then you could use the standard close link. But I'd actually be more familiar with doing it with an iframe. Either way, you would need to deal with the question of what happens if someone gets to your external pages without the 'top' page and/or without javascript enabled.

    Do you have the two pages?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jun 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    I thought you already had the iframe and just wanted a method of closing the sticky. I answered that question. I'm still not sure if you are asking anything more. I can tell you that AJAX may be able to be employed if you have PHP or asp or something like that and your server allows posting with an async request, you could post to fetched content. Then you could use the standard close link. But I'd actually be more familiar with doing it with an iframe. Either way, you would need to deal with the question of what happens if someone gets to your external pages without the 'top' page and/or without javascript enabled.

    Do you have the two pages?
    Thanks for your help, btw...

    You raise two very good points. If a user doesn't have javascript or they can't see the 'top' of the Sticky Note, then they won't be able to close it.

    I do have one of the pages (not uploaded) in an iframe. However, the iframe doesn't line up properly AT ALL...the background image is just all out of whack...and the text doesn't line up, either. So it's getting kind of ugly right now!

    Are there any other simpler options? I'm considering bailing and using the DHTML Widget, but I think it's so horrendously ugly!

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    Iframes can be tricky. And they will eventually be phased out. However,if you don't mind sticking to a DOCTYPE like:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
    "http://www.w3.org/TR/html4/loose.dtd">
    They will be supported for a very long time.

    You should only need this DOCTYPE on your top page, the one with the iframe tag.

    Now, the reason they are tricky is that support varies among browsers. However, with most browsers, if the body of the external page is set in its stylesheet:

    Code:
    body {
    margin:0;
    padding:0;
    }
    and the iframe tag itself is like:

    HTML Code:
    <iframe src="whatever.htm" frameborder="0" width="200" height="300"></iframe>
    (width and height at your discretion, they may both be set as 100% if there is already a container for the iframe on the top page of the desired dimensions)

    Once you have all that, the contents of the external page(s) (whatever.htm in this example) may be left aligned (the default if alignment is not specified) or centered aligned. Either way, the external page will line up with the iframe. If the iframe fills its container, or nearly so, and the external page doesn't exceed the iframe's dimensions, it will look virtually seamless.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •