2016-10-22 1 views
0
$('.form-control').on('focus blur', function (e) { 
    $(this).parents('.form-group').toggleClass('focused', (e.type === 'focus' || this.value.length > 0)); 
}).trigger('blur'); 

$('#moveleft').click(function() { 
    $('#textbox').animate({ 
     'marginLeft': "0" //moves left 
    }); 
    $('.toplam').animate({ 
     'marginLeft': "100%" //moves right 
    }); 
}); 

$('#moveright').click(function() { 
    $('#textbox').animate({ 
     'marginLeft': "50%" //moves right 
    }); 
    $('.toplam').animate({ 
     'marginLeft': "0" //moves right 
    }); 
}); 
+2

où est l'échantillon html –

Répondre

0

Vous essayez de vous connecter à l'événement "flou de mise au point" qui n'existe pas.

Il est soit .on("focus", function(e) { });

ou il est .on("blur", function(e) { });

https://jsfiddle.net/kt0sswfh/