SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    gallerific.js and colorbox...

    so i have been searching for this for a long time


    on this pagehttp://philipdusel.com/vot.html i would like the color box to display a larger image when you click on the main image

    like when you click on the "full size"

    so i installed drupal thinking i would make an an image -node -gallery to replicate this..that i found on a drupal forum and because colorbox is a drupal script i thought i

    // Construct new hidden span for the image
    var imagesrc = imageData.image.src;
    imagesrc = imagesrc.replace("node-gallery-maingallerific", "Average-Image-size");

    /* Lightbox2
    var newSlide = this.$imageContainer
    .append('<span class="image-wrapper current"><a href="'+imagesrc+'" class="lightbox-processed" rel="lightshow" ></a></span>')
    .find('span.current').css('opacity', '0');

    newSlide.find('a')
    .append(imageData.image)
    .click(function(e) {
    e.preventDefault();
    Lightbox.start(this, false, false, false);
    });
    */

    var newSlide = this.$imageContainer
    .append('<span class="image-wrapper current"><a href="'+imagesrc+'?width=500&height=500" class="colorbox" ></a></span>')
    .find('span.current').css('opacity', '0');

    newSlide.find('a')
    .append(imageData.image)
    .click(function(e) {
    e.preventDefault();
    $('a.colorbox').colorbox({width:817, height:500});
    });
    but the script letting the full size link work is so small ill bet i just need to start learning java...
    am i right ...setting up image galleries in drupal is a waste of time and headache... in the case of getting this behavior to work?

    $(document).ready(function(){
    $("a[rel='cbviewer']").live('click' , function (e) {
    $.colorbox({href:$(this).attr("href"), title:$(this).attr("title")});
    });});

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,101
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    The JS seems to work OK to me. It's more the layout (CSS issue) that is broken.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


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
  •