Guest User

Untitled

a guest
Jan 17th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. var myVar;
  2.  
  3. function showDiv() {
  4. var random = Math.floor(Math.random() * $('.notification').length);
  5. $('.notification').eq(random).prependTo('.container').fadeIn(200).delay(3000).fadeOut(200);
  6. createRandomInterval();
  7. }
  8.  
  9. function createRandomInterval() {
  10. setTimeout(showDiv, 500 + Math.random() * 4000);
  11. }
  12. $(document).ready(function() {
  13. createRandomInterval();
  14. });
Add Comment
Please, Sign In to add comment