WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Stray Random Quotes] fade in / out (4 posts)

  1. Steve Taylor
    Member
    Posted 4 years ago #

    I've used Quotes Collection, but Stray Quotes seemed much better so I've shifted. Part of the attraction is that SQ had built-in AJAX auto-rotate.

    However, because for QC it wasn't built-in, I added my own JS to do the trick, and got it working how I wanted: quote fades out, load new quote, quote fades in.

    In SQ, I've set the "loading" text to blank to get rid of it, but I'm not sure of the best way to make the quote fade out then back in. Obviously I can just go in and hack the JS, but is there a better way to alter this without changing plugin files?

    http://wordpress.org/extend/plugins/stray-quotes/

  2. tictok
    Member
    Posted 4 years ago #

    Hey gyrus,

    Did you ever figure out how to make the quotes fade in and out? I'm looking to do exactly the same thing. Any help hugely appreciated!

    Thanks

  3. Steve Taylor
    Member
    Posted 4 years ago #

    I've not addressed this yet, but if I solve it before the feature pops up in SQ, I'll post it here!

  4. Steve Taylor
    Member
    Posted 4 years ago #

    OK, I had to modify the inc/stray_ajax.js file. Here's my current code:

    jQuery(document).ready(function(){});  //needed because FF is stupid
    function newQuote(categories, linkphrase, id, strayurl, multi, offset, sequence, timer, disableaspect, loading, contributor){
    	jQuery(document).ready (
    		function($){
    			var divheight = $("div.stray_quote-" + id).height();
    			$("div.stray_quote-" + id).height( divheight );
    			$("div.stray_quote-" + id + " div").fadeOut('slow', function () {
    				$.ajax({
    					type: "POST",
    					url: strayurl + "inc/stray_ajax.php",
    					data: "action=newquote&categories=" + categories + "&sequence=" + sequence + "&linkphrase=" + linkphrase + "&widgetid=" + id + "&multi=" + multi + "&offset=" + offset + "&disableaspect=" + disableaspect + "&timer=" + timer + "&contributor=" + contributor,
    					success: function(html){
    						$("div.stray_quote-" + id).css('padding-top',null);
    						$("div.stray_quote-" + id).css('height', null);
    						$("div.stray_quote-" + id).replaceWith(html);
    						$("div.stray_quote-" + id).hide().fadeIn('fast');
    					}
    				});
    			});
    		}
    	)
    }

Topic Closed

This topic has been closed to new replies.

About this Topic