Announcement

Collapse
No announcement yet.

Lightbox with category image machine

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Lightbox with category image machine

    I've been using the third script from here http://extranet.mivamerchant.com/for...676#post389676 on my product pages for my image machine script. I'm now setting up the image machine on my category pages, and I would like similar functionality. Is there an API reference guide for the Image Machine somewhere? The hardest part about this is not knowing what functions it is providing.

    For instance, where would I find documentation on things like
    Code:
    ImageMachine.prototype.onthumbnailimageclick
    I'm guessing that things like "ImageMachine.prototype.ImageMachine_Generate_Thum bnail" get called by the Image Machine by each additional image, correct? If this is the case, is there an object where information about the current image is being stored? For instance, in "ImageMachine.prototype.ImageMachine_Generate_Thum bnail" how can I get the product code for the product associated with the current image?

    Any direct help with converting that script to work with category images would be nice, but I think I can also do it myself if I can just get these and probably a few more questions answered.

    Thanks,
    Brian

    #2
    Re: Lightbox with category image machine

    Ok, so I've figured this part out so far
    Code:
        
    ImageMachine.prototype.ImageMachine_Generate_Thumbnail = function (thumbnail_image, main_image, closeup_image, type_code) {
        // Get product id
            var prod_id = (this).main_image.id;
            prod_id = prod_id.split("_")[2];
            var cont_id = "cu_" + prod_id;
            
            if ($("#" + cont_id).length == 0) {
                var cu = $('<div id=cu_"' + prod_id + '" />').hide();
                $("body").append(cu);
            }
            
            var $cont = $("#cu_" + cont_id);
            var $cu_img = $("<img>", {
                    src: "" + closeup_image,
                    rel: "closeups"
                });
            $cont.append($cu_img);
    };
    But the problem is when the <div id="cu_prod_id"> elements are created, something about the format of the string I'm pulling from the Image Machine object is causing problems (I think). In the html inspector it looks like
    HTML Code:
    <div id='cu_"9355"' ></div>
    Notice how the quotes don't get stripped from the id string? I tried stripping them by doing a substring method, and by replacing them, but it doesn't seem to work. Any ideas?

    Comment

    Working...
    X