Results 1 to 3 of 3

Thread: Ultimate Fade-in slideshow image width

  1. #1
    Join Date
    Jul 2005
    Posts
    39
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Ultimate Fade-in slideshow image width

    1) Script Title: Ultimate Fade-in slideshow (v1.5)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem: (Not a problem, but a "tweak-possible" question): Is it possible somehow to specify a new 'virtual' width for each image in the slideshow? That is, my script might draw upon a directory of images that are all say, 600px wide, but can I specify in the js somehow that they should appear at a smaller size, say, 400px wide (like doing "width="400" in HTML)?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As the script is written, you would have to modify it. If you only have one show on the page, it is easier to just go here:

    fadeshow.prototype.populateslide=function(picobj, picindex){
    var slideHTML=""
    if (this.theimages[picindex][1]!="") //if associated link exists for image
    slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
    slideHTML+='<img width="400" src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
    if (this.theimages[picindex][1]!="") //if associated link exists for image
    slideHTML+='</a>'
    picobj.innerHTML=slideHTML
    }

    and add in the width that you want as shown above in red.

    If you have more than one slide show on the page and each slide show needs a different width set, it can be done but is a little more complicated. Let me know if you need that. You are better off (for many reasons) resizing your images in an image processing program.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    39
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Brilliant!

    I do have only one slideshow on the page in question, and the change is indeed only from 600px to 400px wide, so I don't think there's much overhead.

    Thank you very much! That's brilliant!

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
  •