Results 1 to 3 of 3

Thread: Ultimate Fade-in slideshow (2.1) caption placement

  1. #1
    Join Date
    Apr 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow (2.1) caption placement

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

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

    3) Describe problem: I was able to modify the location of the caption, but it always remains in the same place. The heights of the images in my slideshow varies, and I would like to determine the height of the current image and place each caption underneath the current image.

    My page is here:
    http://www.bluepupae.com/test/presid...ist.php?code=1

    I tried setting top on desc panel --> setting.$descpanel.css({top:setting.$gallerylayers.find('img').height()})

    but it only works on the first image. the caption still stays in the same position.

    thanks.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Try using the undocumented onslide event handler inside your initialization code as follows:

    Code:
    var mygallery2=new fadeSlideShow({
    	wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
    	dimensions: [250, 380], //width/height of gallery in pixels. Should reflect dimensions of largest image
    	imagearray: [
    		["http://i26.tinypic.com/11l7ls0.jpg", "", "", "Nothing beats relaxing next to the pool when the weather is hot."],
    		["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Some day I'd like to explore these caves!"],
    		["http://i30.tinypic.com/531q3n.jpg"],
    		["http://i31.tinypic.com/119w28m.jpg", "", "", "What a beautiful scene with everything changing colors."] //<--no trailing comma after very last image element!
    	],
    	displaymode: {type:'manual', pause:2500, cycles:0, wraparound:false},
    	persist: false, //remember last viewed slide and recall within same session?
    	fadeduration: 500, //transition duration (milliseconds)
    	descreveal: "always",
    	togglerid: "fadeshow2toggler",
    	onslide:function(curlayer, curimage){
    		var $image=jQuery(curlayer).find('img').eq(curimage) //reference current image being shown
    		var $descpanel=this.setting.$descpanel //reference description panel
    		$descpanel.css({top:parseInt($image.css('marginTop'))+parseInt($image.height())})
    	}
    })
    Add the portion in red to your initialization code (don't forget the trailing comma (') that should follow all options except the very last one, in this case onslide()). Basically what the code does is repositions the description panel at the end of each image when the slideshow rotates.
    DD Admin

  3. #3
    Join Date
    Apr 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you. I added the following and it works beautifully!

    onslide:function(curlayer, curimage){
    var $image=jQuery(curlayer).find('img').eq(curimage) //reference current image being shown
    var $descpanel=this.setting.$descpanel //reference description panel
    $descpanel.css({toparseInt($image.height()) + 5})
    }

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
  •