mercredi 23 décembre 2015

How to stop typed.js when an input box is clicked

I am trying to use typed.js to give example cities in this text input box. My goal is to have it completely stop the animation when it is clicked on. How would I go about this?

JS:

$(document).ready(function(){
$(function()
{
    $("#input_text").typed(
    {
        strings: ["^2000", "New York City^2000", "Berlin^2000", "London^2000", "Hong Kong^2000", "Chicago^2000", ""],
        typeSpeed: 50
    });
});
$( "#input_text" ).click(function()
{
    $( "#input_text" ).stop();
});
}); 

I'm pretty new to javascript so could you please tell me what I'm doing wrong?




Aucun commentaire:

Enregistrer un commentaire