SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    1,963
    Mentioned
    0 Post(s)
    Tagged
    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");
    //console.log(DOMAINE_NAME+'/images/slideshow/'+_this_.arr_img[imgIndex]+'.jpg');
    $('#'+_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: http://www.mydomain.com/images/slideshow/image.jpg

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

    HTML Code:
    <img src="http://www.hotelbanville.fr/mga_client/idiap/accueil/306824e81fd38e2c3a1672cbca4cbfd7.jpg" 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
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    If you're going to be using fully qualified paths, you can get rid of this part:
    http://'+DOMAINE_NAME+'/images/slideshow/
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •