API and gallery call
  • Hi, I am trying to do on my site:

    API calls

    var images = new Array('images/fullscreen/1.jpg','images/fullscreen/2.jpg','images/fullscreen/3.jpg');
    var titles = new Array('Title 1','Title 2','Title 3');
    var descriptions = new Array('Description 1','Description 2','Description 3')

    No title, no description

    It tells me: Error: itemSrc.match is not a function
    Source: file:///C:/Users/Jay/Downloads/prettyPhoto_uncompressed_2.5.6/js/jquery.prettyPhoto.js
    Line: 534

    Any idea why?
  • Jay,
    I had simliar issue but i fixed by using angle brackets instead of array and by wiring up my click event for the anchor tag using jquery in document.ready

    var images = [
    '/media/2789/bouzouki.jpg',
    '/media/2792/butterfly.jpg',
    '/media/2794/comfrey.jpg',
    '/media/2796/foxglove.jpg',
    '/media/2798/goldengreenflower.jpg',
    '/media/2800/guitars.jpg',
    '/media/2802/ice.jpg',
    '/media/2804/mousemat.jpg',
    '/media/2806/vegs.jpg'];
    var titles = [
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    ''];
    var descriptions = [
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    ''];
    $(document).ready(function(){
    $("#view-gallery").click(function(){
    $.prettyPhoto.open(images,titles,descriptions);
    })

    });

    Regards

    Ismail
  • Hi, I'm trying too, but...

    anyone option works for me.

    here is my code:
    HEAD tags




    var images = [
    'img/001.jpg',
    'img/002.jpg'
    ];
    var titles = [
    "title 01",
    "title 02"
    ];
    var descriptions = [
    "description 01",
    "description 02"
    ];

    $(document).ready(function(){
    $("#view-gallery").click(function(){
    $.prettyPhoto.open(images,titles,descriptions);
    })
    });


    BODY tags
    CLICK HERE

    I get message: $.prettyPhoto.open is not a function

    I can't get to work the PrettyPhoto API.

    thx

    JJ
  • I've the same problem, when I use :
    function widget_success_submit(responseText, statusText) {
    $.prettyPhoto.open('responseText','Title','Description');
    }

    I'm getting the same error :
    $.prettyPhoto.open is not a function

    //////////////////////
    // Edited
    //////////////////////
    I think you should call prettyPhoto at least one time so as u can use the API.
    so, just add :
    $("a[rel^='prettyPhoto']").prettyPhoto();
    then u can use the API, at least it works fine for me in this way
  • But doesn't that just negate the purpose of the API?
  • You don't have to go through all that:

    $(document).ready(function(){

    $().prettyPhoto();

    $('#link').click(function() {

    $.prettyPhoto.open('http://www.google.com?iframe=true&width=70%&height=70%','','');

    });

    });

Howdy, Stranger!

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