Possible to use prettyPhoto within innerHTML?
  • I have this code
    text = document.getElementById(\"packageText\");
    image = document.getElementById(\"packageImage\");

    if (index == 1) {
    image.innerHTML = '<a href=\"largePackageImage\" rel=\"prettyPhoto\"><img src=\"ThunbPackageImage\" alt=\"\"/></a>';
    text.innerHTML = \"<p>Text that gets changed</p>\";
    }

    ...etc etc

    I am extreme novice when it comes to this as this is my first ever website. The effect that I am trying to achieve is to enable the Text and Image inside an area (index 1)to change when I select different buttons (5 buttons in total, this works fine with no issues). However, the image that changes is just a thumbnail, or link, to a larger image that I want to appear in a lightbox (prettyphoto). From the code I have, when I click on the image all it does is open up in a new window, displaying the larger copy.

    Note this code is located inside
    <script type=\"text/javascript\"></script>
    and so is not part of the Body.

    I could well just being stupid, I don't know so please have mercy, and a solution if possible.

    Thanks, Repus89

    EDIT: Just to confirm, I do have prettyPhoto working on the website under a different section, so I know it is set up correctly
  • I don't suppose anyone has a solution to this problem?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter