SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    0 Post(s)
    0 Thread(s)

    absolute or relative path for slideshow images

    I found an jQuery/javascript slideshow which I try to duplicate. You can find the one I'm talking about here. I downloaded the files needed jQuery, slideme and script but I can't get it to work. In other words the pictures simply don't show. The funny thing is though that when you look in the slideme library they refer to the pictures the following way:
    Code JavaScript:
    //console.log('le background devient : '+_this_.arr_img[imgIndex]+"\n");
    $('#'+_this_.sliderId).css('backgroundImage', 'url('+$('#'+_this_.arr_img[imgIndex]).attr('src')+')');
    //$('#'+_this_.sliderId).css('backgroundImage', 'url(http://'+DOMAINE_NAME+'/images/slideshow/'+_this_.arr_img[imgIndex]+'.jpg)');

    In other words the pictures should be at following location:

    But in the html the pictures are in a complete different location:

    HTML Code:
    <img src="" id="img1" class="slideme" />
    I have tried everything but the pictures simply don't show. Does anybody have any experience with this kind of slideshow an see what i'm doing wrong?

    Thank you in advance.
    Last edited by paul_wilkins; Dec 14, 2011 at 15:44. Reason: fix incorrectly parsed link
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Christchurch, New Zealand
    104 Post(s)
    4 Thread(s)
    If you're going to be using fully qualified paths, you can get rid of this part:
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts