SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot backtobasics's Avatar
    Join Date
    Aug 2006
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript conflictions

    I'm not sure if this is actually a 'confliction' as such.

    However, I am using Lighbox JS in a website I am developing. Now, to open an image with Lighbox you need to add 'rel="lightbox' in your image link.

    The problem is I am loading content dynamically using some AJAX, and when I click a link to open up an image using Lightbox...it doesn't happen!

    I'm sure it is some sort of confliction between the page and the dynamic content. Is there any way I can fix this?

    Cheers

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It most likely is an onload conflict. Do you anything in the onload attribute in the body tag? Do you also have things in external javascript/embedded in the head that fire with window.onload ? The best thing is to simply put them together:
    Code:
    window.onload = function() {
      lightboxInit();
      ajaxStart();
      someMoreJavascript();
    }
    and so on.

  3. #3
    SitePoint Zealot backtobasics's Avatar
    Join Date
    Aug 2006
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply, but this isn't the problem! I already have both these loading OK.

    Any other possibilities?

  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Got a link?


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
  •