Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Start Jquery Animation When Hidden Div is Called?
    primarykey
    data
    text
    <p>I have a hidden div in which I have a jquery running a typewriter animation. I was wondering how I can ge the animation to start once the div is revealed? At the moment when the div is revealed the type is already there. </p> <p>Here is whats essentially happening now <a href="http://jsfiddle.net/caW8d/" rel="nofollow">http://jsfiddle.net/caW8d/</a></p> <pre><code>$(document).ready(function() /*-----------------FADE EFFECT --------------------*/ { var synopsis = $('#synopsis'); function runIt() { synopsis.animate({opacity:'+=1'}, 1000); synopsis.animate({opacity:'-=0.9'}, 2000, runIt).delay(2000); } runIt(); $("#trigger1").mouseover(function () { $("#somethingThere").fadeIn('slow'); }); $("#trigger1").mouseout(function() { $("#somethingThere").fadeOut('slow'); }); $("#trigger1").click(function () { $("#caption").fadeIn('slow'); }); $("#caption").click(function () { $("#caption").hide(); }); /*-----------------TYPERWRITER EFFECT --------------------*/ $.fn.typer = function(options) { var defaults = {speed: 50}, settings = $.extend({}, defaults, options); return this.each(function(e,options){ var el = $(this), text = el.html(), chars = 0, timeout = null, tw = function() { el.html(text.substr(0, chars)); chars += 1; timeout = setTimeout(function(){tw();}, settings.speed); if(text.length === chars){clearTimeout(timeout);} }; el.html(""); tw(); }); }; })(jQuery); $(function(){ $('div').typer({speed:25}); }); </code></pre> <p>And here is what the animation should look like <a href="http://jsfiddle.net/yMYgZ/" rel="nofollow">http://jsfiddle.net/yMYgZ/</a></p> <pre><code>(function($) { $.fn.typer = function(options) { var defaults = {speed: 50}, settings = $.extend({}, defaults, options); return this.each(function(e,options){ var el = $(this), text = el.html(), chars = 0, timeout = null, tw = function() { el.html(text.substr(0, chars)); chars += 1; timeout = setTimeout(function(){tw();}, settings.speed); if(text.length === chars){clearTimeout(timeout);} }; el.html(""); tw(); }); }; })(jQuery); $(function(){ $('div').typer({speed:25}); }); </code></pre> <p>Any help would be greatly appreciated. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload