Results 1 to 9 of 9

Thread: Problem with Lighbox on a Dynamic AJAX Content Page

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

    Default Problem with Lighbox on a Dynamic AJAX Content Page

    1) Script Title: Dynamic AJAX Content

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

    3) Describe problem:

    I have designed my page to load all pages using Dynamic AJAX Content Script. All works fine, thanks to the uploader!

    But got in totrouble just lately, I need to use Lightbox on one of the AJAX page. The Lighbox run as intended when running the page alone but won't work when called using Dynamic AJAX Content script.

    I got the Lighbox script from this link... http://www.digitalia.be/software/slimbox

    What will I do? Please Help.
    Thanks!

  2. #2
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Anyone Please?

  3. #3
    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

    Slimbox isn't a DD script. However lightbox is. It's most recent version (though it has a correctable problem with duplicate images in groups) will work well in an AJAX environment:

    http://www.lokeshdhakar.com/projects/lightbox2/

    Just add the script to your 'top' page and place the lightbox links on the top page and/or on the imported page(s). Paths to images (and anything else) on the imported page must be either absolute, or if relative, relative to the top page.

    If you need more help:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    cyberjorge (09-17-2008)

  5. #4
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks a lot John!

    I've used lightbox instead as suggested and I followed the instructions you have provided for configuring lightbox on other threads here in DD.

    Thanks again!

  6. #5
    Join Date
    Sep 2008
    Location
    Seattle, WA
    Posts
    135
    Thanks
    1
    Thanked 11 Times in 11 Posts

    Default

    I have the exact same problem! I'm using the ajax dynamic content and the pages being pulled in have images in them where they have the rel="lightbox" (or rel="facebox", tried both). In my case, though, it works just the first time you summon the lightbox effect then it won't work on any of the other pages summoned. I have a post on this already:

    http://www.dynamicdrive.com/forums/s...ad.php?t=36621

    Need some ideas on this one. Thanks!

  7. #6
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    @ John
    So far my site works perfectly for Lightbox 2.04 on Dynamic AJAX page, my problem now is I need to show texts so I resort on using GreyBox, but the problem is again it won't work on Dynamic AJAX page. If only I can load texts in Lightbox.

    Here's the link to the test site. MY SITE.
    All of the sub pages are loaded using Dynamic AJAX Page, on the Home page click on the first property image or the banner on the left side. On the resulting Properties page, clicking the image will activate Lightbox and clicking the the texts will activate Greybox. Clicking this from the index page will not work, but will work directly on this link: DIRECT LINK.

    @ simcomedia
    Try looking at my codes, this might help you. I've ran into the trouble before as posted earlier, I just followed jscheuer1's instructions on other threads.
    Last edited by cyberjorge; 09-18-2008 at 06:25 AM.

  8. #7
    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

    Just by way of explanation, the reason why lightbox 2.04 works with AJAX loaded content is that instead of initializing each link (old method) that has a rel="lightbox" attribute to perform as a part of the script by giving it an onclick event, it gives the entire window an onclick event. Whenever the page in the window is clicked, this event checks to see if a lightbox link was clicked, if so - it launches the lightbox viewer. That way you can load in new lightbox links at any time, instead of the old way, where they either had to already be on the page when the onload event fired, or be initialized after they were added.

    I'm not up on Greybox. But I just tried their demo site though, and none of the examples I tried worked, and there were errors. I tried in several browsers, none worked.

    So I'm pretty sure that if it won't work on their site without AJAX, it won't work on your site with AJAX.

    I tried your test pages, and they seemed to work - sort of. But that's lightbox working, not Greybox. The two scripts (even if Greybox worked at all) should probably not be combined on one page.

    Now, I'm not sure what you mean by needing text. Lightbox can display captions. Isn't that enough?
    - John
    ________________________

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

  9. #8
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi John,

    Thanks for the reply, I understand your not up on Greybox.

    I really love Lightbox's effect on the user experience and it's painless implementation,
    what I'm trying to achieve though is a pop-up page that can hold texts/page with the same effect as Lightbox does. Much like this one...



    Caption on the Lightbox images are good, but there should always be an images to put a text and the control for the text are limited.

    Thanks, I appreciate your help.


    Jorge

  10. #9
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Ok got it working finally after posting a question on their site.

    It also has the advance function just like the Lightbox does, you just need to use that code disabled by default.

    To answer why I used the two, let's just say I want to get the best of both worlds!

    I just wish Lightbox will support loading page in the coming days...

    Thanks a lot for everything!!!

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
  •