Results 1 to 5 of 5

Thread: Lightbox-like script

  1. #1
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Question Lightbox-like script

    Hello,
    I am looking for a script that has an in-window popup (kind of like this one that I found: http://www.openwebware.com/products/openpopups/ )
    but when the pop ups come up, the rest of the screen becomes dark, but not solid, semi-transparent like if you held a black plastic film over your entire screen with just the pop-up showing. I have seen this done in DD's lightbox script, and on freewebs. Maybe it's just a line of code I need to add?
    Thanks in advanced,
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    the dynamic drive lightbox is just a replica with mods of the original

    http://www.huddletogether.com/projects/lightbox/

    as John pointed out there are a number of others that have since been developed

    http://particletree.com/features/lightbox-gone-wild/
    http://www.fortysomething.ca/mt/etc/archives/005400.php
    http://www.huddletogether.com/projects/lightbox2/

  4. #4
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    Thanks guys, I used the thick box script that jscheuer1 gave me. One more question, from an iframe in the box, is it possable to add a value into a text box on the main page, and\or change somthing on the page, That's the whole reason for this script. Thanks,
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Although I recommended thickbox, I'm not familiar with it. I did go over the specs though, and it looked highly suitable, well conceived, and written.

    And, unless something pretty odd is going on with it that I am unaware of, its iframes should behave like any others. If they do, the answer is - Yes, as long as both pages are on the same domain.

    From a page in an iframe, the containing (usually the top) page (actually window) is the parent. So you could do something like so on the page in the iframe:

    Code:
    parent.document.forms['form_name'].elements['input_name'].value='whatever';
    or:

    Code:
    parent.document.getElementById('id_of_element').firstChild.nodeValue='whatever';
    In the first case form_name would be the name of the form on the top page and input_name would be the name of an input element (button, text field, hidden field, etc.) in that form, and whatever would be the value you wish to assign to it.

    In the second case id_of_element would be the id of - say, a span on the top page that contains text only (at least a   entity), and whatever would be the text to assign to it.

    There are many variations on how this parent reference may be used, the above are just two examples. But, as I said, the two pages must be on the same domain.

    If you want to carry out complex actions on the top page, it is best to have a function already on the top page that will do so, and to call it from the child page in the iframe like so:

    Code:
    parent.complexFunc();
    where complexFunc is the name of the function on the top page.
    - 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
  •