Results 1 to 2 of 2

Thread: Ultimate Fade-in slideshow (v2.4)

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

    Cool Ultimate Fade-in slideshow (v2.4)

    Hi, I need help on Ultimate Fade-in slideshow (v2.4).

    I tried to put my own "peekaboo" div, in a front layer, showing left to right.

    MY CSS:

    Code:
    #info2 {
    display:inline-block; 
    width:auto;
    margin-top:200px;
    text-align:left; 
    padding:20px; 
    font-size:28px; 
    color:#FFFFFF; 
    font-family: "DinProRegWeb", Arial, Helvetica, sans-serif;
    text-shadow: #666666 0.1em 0.1em 0.2em;
    font-weight:bold;
    background: rgba(0,0,0,0.2);
    visibility:hidden;
    }
    MY JAVASCRIPT:
    Code:
    var mygallery=new fadeSlideShow({
    	wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    	dimensions: [960, 360], //width/height of gallery in pixels. Should reflect dimensions of largest image
    	imagearray: fadeimages001,
    	displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
    	persist: false, //remember last viewed slide and recall within same session?
    	fadeduration: 1500, //transition duration (milliseconds)
    	descreveal: "ondemand",
    	descreveal: "none",	
    	togglerid: "",
    	onslide:function(curimage, index){
    	jQuery('#info2').css('visibility', 'visible')
    	var imagearray=this.setting.imagearray
               var effect = 'slide'
               var options = { direction: 'left' }
               var duration = 700
    	jQuery('#info2').html(imagearray[index][3]).hide().show(effect, options, duration)
    	}	
    })
    THE SCRIPT WORKS OK, shows the next (new) image descriptions triggered by onslide, AFTER the new images is displayed.

    QUESTION:

    I want to hide the "current image description" (div) BEFORE skipping to the next image.

    Thank you,
    TNT

    Last edited by jscheuer1; 04-17-2014 at 12:36 PM. Reason: Format

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

    Default

    Add this code to the end of the fadeslideshow.js file:

    Code:
    // On Before Slide Script (c)2013 John Davenport Scheuer
    // as first seen in http://www.dynamicdrive.com/forums/
    // username: jscheuer1 - This Notice Must Remain for Legal Use
    // for/requires Ultimate Fade In Slideshow
    
    jQuery.extend(fadeSlideShow.prototype, {
    	paginateinit:function($){ // replaces native paginate function
    		var slideshow=this
    		var setting=this.setting;
    		if (setting.togglerid){ //if toggler div defined
    			setting.$togglerdiv=$("#"+setting.togglerid+", ."+setting.togglerid); // add togglerid as a class to allow multiple cotrol divs
    			setting.$prev=setting.$togglerdiv.find('.prev').data('action', 'prev');
    			setting.$next=setting.$togglerdiv.find('.next').data('action', 'next');
    			setting.$status=setting.$togglerdiv.find('.status')
    			setting.$prev.add(setting.$next).click(function(e){ //assign click behavior to prev and next controls
    				slideshow.navigate($(this).data('action'));
    				e.preventDefault();
    			});
    		}
    		var show = this.showslide;
    		this.showslide = function(keyword){ // extend native showslide function to provide an onbeforeslide callback function
    			var lng = setting.imagearray.length, idx = keyword === 'next'? (setting.curimage + 1) % lng : keyword === 'prev'?
    				(setting.curimage - 1 + lng) % lng : keyword;
    			if(setting.displaymode.type !== "auto" || (!setting.ismouseover && setting.currentstep <= setting.totalsteps)){
    				if (setting.onbeforeslide){
    					try{setting.onbeforeslide.call(this, idx);}catch(e){
    						alert('Fade In Slideshow error: An error has occured somwhere in your code attached to the "onbeforeslide" event: ' + e);
    					}
    				}
    			}
    			show.apply(this, [keyword]);
    		};
    	}
    });
    Save and use that version. Now, in addition to the onslide(curimage, index) function, you may also use an onbeforeslide(idx) function. Use it to hide the current description before sliding. In said function, the keyword this will refer to the slideshow instance and the single available parameter is the index of the slide which will be shown next. Ex:

    Code:
    onbeforeslide: function(idx){
    	jQuery('#info').hide();
    }
    The browser cache may need to be cleared and/or the page refreshed to see changes.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

Similar Threads

  1. Ultimate Fade-in Slideshow -- Fade Duration and Pause
    By ellenjones6 in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 02-21-2014, 05:18 PM
  2. Remove initial fade in from Ultimate Fade-in slideshow
    By optimus203 in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-14-2012, 06:37 PM
  3. Replies: 3
    Last Post: 07-12-2010, 04:04 PM
  4. Ultimate fade-in slideshow - fade-in time change
    By TheJoe in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-06-2009, 04:51 PM
  5. Ultimate Fade in Slideshow - how to require FIRST image to fade in?
    By charmedworks in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 06-17-2008, 07:12 PM

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
  •