Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. jQuery.fn.pushNotification = function(message, type ,speed){
  2. var pushBox = "push-notification",
  3. pushNotification = "<div class='"+ pushBox +"'></div>";
  4.  
  5. $(pushNotification).appendTo( $( 'header' ) );
  6.  
  7. $(this).click(function(){
  8.  
  9. if (type == "alert"){
  10. $("."+pushBox).css("background-color", "#d15e3e");
  11. $("."+pushBox).text(message);
  12. } else if (type == "succes"){
  13. $("."+pushBox).css("background-color", "#9ad362");
  14. $("."+pushBox).text(message);
  15. } else if (type == "info"){
  16. $("."+pushBox).css("background-color", "#195a89");
  17. $("."+pushBox).text(message);
  18. }
  19. $("."+pushBox).animate({ right: "-10px" }, speed );
  20. setTimeout(function(){
  21. $("."+pushBox).animate({ right: "-300px" }, speed );
  22. }, 2000);
  23.  
  24. });
  25. }
  26.  
  27. $(".sI5").pushNotification("Presentatie verwijderd", "alert", 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement