Jump to content

Javascript in AJAX Content


Liquid Fire

Recommended Posts

I think this is where this question should go becuase it is mainly a javascript questyion.

 

I have a lightbox(slimbox) to show a image gallery. when i load the page it works fine.  when I laod the smae page with ajax it does not work.  is there a problem with doing javascript in ajax loading content?

Link to comment
Share on other sites

The problem is the lightboxes out there only look at the HTML code when the page loads, so if you using AJAX to load the page, the lightbox won't know it has to look for the links, therefore not working. To fix that, look at your lightbox script and find the initiating function and find what events the script add to the links. You can call that function when the AJAX page loads as well.

Link to comment
Share on other sites

yea, I found a modified version of the lightbox that has the lightbox as a class so you can add content to it on the fly, this might work for me but i have to try it to see if it does and if not I will take a look at the code to see if i can add links somehow.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.