Advertisement
Guest User

Untitled

a guest
Dec 16th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. $(document).ready(function(){
  2. $(".login_menu").hide();
  3. $(".btn-show-login").on("click", function(e){
  4. $(".login_menu").slideToggle();
  5. e.preventDefault();
  6. });
  7.  
  8. $(".error").hide();
  9. $(".profiel").hide()
  10.  
  11. $(".profiel_foto_klein").hide();
  12. $(".aanmelden").on("click", function(e) {
  13. var username = $("#username").val();
  14. var password = $("#password").val();
  15. if (username=="pin" && password=="terest") {
  16. $(".profiel_foto_klein").show();
  17. $(".login-text").text("we Are IMD");
  18. $(".profiel").show();
  19.  
  20. setTimeout(function(){
  21. $(".pins_discussion").addClass("pins_discussion_active").text("2");
  22. }, 3000);
  23.  
  24. }
  25. else {
  26. $(".error").text("Login failed!").slideDown();
  27. e.preventDefault();
  28. }
  29. });
  30. var popup = $(".popup");
  31. popup.hide();
  32. $(".btn-create").on("click", function(e){
  33. popup.show();
  34. $(".menu").hide();
  35. e.preventDefault();
  36. });
  37.  
  38. $(".btn_name_board").on("click", function(e){
  39. var name_board = $(".name_board");
  40. if (name_board.val()==""){
  41. name_board.css("border", "1px solid red");
  42. }
  43. else {
  44. $(".popup").hide();
  45. var newBoard = $("<div></div>").addClass("board_logo new");
  46. var newBoardName = $("<div></div>").addClass("boardName").text(name_board.val());
  47. var newBoardImg = $("<img></img>").attr("src", "images/newboard.jpg").attr("width", "216");
  48. var EditLink = $("<a></a>").addClass("edit_board").attr("href", "#").text("Edit");
  49. newBoard.append(newBoardName).append(newBoardImg).append(EditLink);
  50. $(".board_logo").last().after(newBoard);
  51. updateCounter();
  52. e.preventDefault();
  53. }
  54.  
  55. });
  56.  
  57. function updateCounter() {
  58. var numberOfBoards = $(".new").length;
  59. var updateCounter = 4 + numberOfBoards;
  60. $(".aantal_borden").text(updateCounter);
  61. }
  62. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement