v2.5.2
Giriş yap

Jquery içerisinde css animation kodunu nasıl yazabilirim?

heissinberg
453 defa görüntülendi ve 1 kişi tarafından değerlendirildi
    $(".circle").css({
  -webkit-animation:progress 5s ease-out forwards,
  animation:progress 5s ease-out forwards,
});

jquery ile css animasyon kodunu bu şekilde yazdığım zaman syntax hatası alıyorum. Bu kodu js ile nasıl yazmam gerekiyor?

Cevap yaz
Cevaplar (3)
omerf
922 gün önce
$(".circle").css({"-webkit-animation": "progress 5s ease-out forwards", "animation": "progress 5s ease-out forwards"});
mebo
924 gün önce

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js&quot;&gt;&lt;/script&gt;
<script>
$(document).ready(function(){
$("button").click(function(){

$(".h1").addClass("animasyon");

});
});
</script>

<style>

.animasyon{

transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out; /* FF 4 */
-webkit-transition: all 1s ease-in-out; /* Safari & Chrome */
-o-transition: all 1s ease-in-out; /* Opera */
    margin-left: 100px;
font-size: 100px;
color: red;

}

</style>
</head>
<body>

<button>Başla</button>
<h1 class="h1">Mehmet</h1>

</body>
</html>

mebo
924 gün önce

bahsetmiş olduğun css kodlarını bir css classa yaz daha sonra $(".circle").addClass(classismi); şeklinde yazarsa sorunun çözülür diye düşünüyorum