Pure css simple warning box with jitter effect_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:49:12
Original
1641 people have browsed it

The warning box with this effect will shake if something goes wrong

.alert-box { width: 400px; border-style: outset; position: relative; color:#555; border-radius:10px; font-family:Tahoma,Geneva,Arial,sans-serif;font-size:11px; padding:10px 10px 10px 10px; margin:auto; display: none; }      .alert-box span { font-weight:bold; text-transform:uppercase; }      .error { background:#ffecec no-repeat 10px 50%; border:1px solid #f5aca6; }
Copy after login

jQuery animation effect, animate for loop 4 times to move around

var $box = $('.alert-box');                  $box.html('<span>error: </span>' + data.error);                  $box.show();                  var box_left = ($(window).width() -  $box.width()) / 2;                  for(var i=1; 4>=i; i++){                      $box.animate({left:-(40-10*i)},50);                      $box.animate({left:+2*(40-10*i)},50);                  }
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template