javascript - Loading animation is not working across browsers -


i have basic loading animation. supposed run when user clicks on upload button.

now works in chrome , uc browser. isn't working in safari , opera mini. must support these browsers too.

first time developing such stuff, hence confused going wrong. css isn't working jquery isn't executing?

my html code:

  {{ form.photo1 }}   <div class="loader">       <div class="spinner"></div>   aik min</div>   <input type="submit" class="uploadbtn btn bl cl bco mbs mts" style="border-color:#f57c00;" value="upload"> 

my css code:

.loader {     font-size: 20px;     font-family: serif;     color: #00c853;     display: none; } .spinner {     border: 5px solid #f3f3f3;     border-radius: 50%;     border-top: 5px solid #ffa000;     border-right: 5px solid #00c853;     border-bottom: 5px solid #ff9933;     border-left: 5px solid #00c853;     width: 50px;     height: 50px;     -webkit-animation: spin 2s linear infinite;     animation: spin 2s linear infinite;     display: none;  } @-webkit-keyframes spin {   0% {     transform: rotate(0deg);     -ms-transform: rotate(0deg);     /* added vendor specific css (ie) */     -webkit-transform: rotate(0deg);     /* added vendor specific css (safari, opera , chrome) */   }   100% {     transform: rotate(360deg);     -ms-transform: rotate(360deg);     /* added vendor specific css (ie) */     -webkit-transform: rotate(360deg);     /* added vendor specific css (safari, opera , chrome) */   } }  @-o-keyframes spin {   0% {     transform: rotate(0deg);     -ms-transform: rotate(0deg);     /* added vendor specific css (ie) */     -webkit-transform: rotate(0deg);     /* added vendor specific css (safari, opera , chrome) */   }   100% {     transform: rotate(360deg);     -ms-transform: rotate(360deg);     /* added vendor specific css (ie) */     -webkit-transform: rotate(360deg);     /* added vendor specific css (safari, opera , chrome) */   } }  @keyframes spin {   0% {     transform: rotate(0deg);     -ms-transform: rotate(0deg);     /* added vendor specific css (ie) */     -webkit-transform: rotate(0deg);     /* added vendor specific css (safari, opera , chrome) */   }   100% {     transform: rotate(360deg);     -ms-transform: rotate(360deg);     /* added vendor specific css (ie) */     -webkit-transform: rotate(360deg);     /* added vendor specific css (safari, opera , chrome) */   }     } 

my jquery code:

$(document).ready(function() {     $(document).on("click", ".uploadbtn", function(event) {         $(".p").each(function(file) {             if  ($(this).val()) {                 $(".loader").show();                 $(".spinner").show();                 $("#overlay").show();             }         })     }); }); 

please note 'p' class {{ form.photo1 }} written in django.

according can use animation , transform not supported in opera mini , old versions of safari. therefore chance fallback js animations in browsers or better use animated gif loading animation.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -