Jump to content

Raktim

Members
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Raktim

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Raktim

    Animated Modal Box

    Thanks for helped me. I need some time to understand the code. Because I am a JS beginner, not JQuery...
  2. Raktim

    Animated Modal Box

    I create a modal box that when the user clicks on the button the modal will appear with animation. When the user clicks on the close button ( located on the right side of the header area ) or anywhere of the screen except modal box it will disappear without animation. I want that the modal will disappear/hide with animation. I create two CSS animation. One is animatetop which I already used when modal will open and another is animatedown which I want to use when modal will disappear. But, I can't understand how to do that? See the code on JSFiddle <html> <head> <style> .background{ display:none; position: fixed; z-index: 1; height: 100%; left: 0; top: 0; width: 100%; padding: 100px; background-color: rgba(0,0,0,0.4); } .modal{ background-color: white; position: relative; border: 1px solid #888; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); animation-name: animatetop; animation-duration: 0.4s; width: 80%; } .header{ width: 100%; padding: 8px 20px; background-color: crimson; color: white; } .footer{ width: 100%; padding: 8px 20px; background-color: lime; color: white; } .middle{ width: 100%; padding: 2px 20px; background-color: white; color: black; } h2{ margin: 0px; } @keyframes animatetop { from {top:-300px; opacity:0} to {top:0; opacity:1} } @keyframes animatedown { from {top:0; opacity:1} to {top:-300px; opacity:0} } span{ float: right; color: white; font-size: 28px; font-weight: bold; cursor: pointer; padding: 2px 5px; } </style> </head> <body> <button onclick="modal()">Open Modal</button> <div class="background" id="MyModal"> <div class="modal" id="modal"> <div class="header"> <span onClick="a()">&times;</span> <h2>Header</h2> </div> <div class="middle"> <h1>Modal</h1><br> <h1>Popup Box</h1> </div> <div class="footer"> <h2>Footer</h2> </div> </div> </div> </body> <script> background = document.getElementById("MyModal"); function modal() { document.getElementById("MyModal").style.display = "block"; } function a() { document.getElementById("MyModal").style.display = "none"; } window.onclick = function (event) { if(event.target == background) { document.getElementById("MyModal").style.display = "none"; } } </script> </html>
  3. Yes, both work fine. Tanks
  4. Sir, I make two pattern [A-z]{7}\d which can match this string Raktimf8 If I change the position of \d like \d[A-z]{7} then it can match this string 8Raktims How I match this pattern Rakti8ms
  5. I want to make that input take only 2 number at least one lowercase, one uppercase and at least 8 characters except number. I tried this pattern... (?=(.*\d){2})(?=.*[A-z])(?=.*[a-z])[A-z!"#$%&'()*+,-.\/:;<=>?@[\]^_`{|}~]{8,} But it totally fails. Then what should be my correct pattern to do that? I want Like... Abc4k9h2L ->FALSE Abc4k9hL+ ->TRUE Abc4l@s$kl4 ->TRUE
  6. But, those 2 string does not full match. 1 string only charecter 5 is matched and 2nd string only F8 are matched. But I want to do match the complete string. How to modify that?
  7. I also have another question (?=(.*\d){2})(?=.*[A-Z])(?=.*[a-z]) If I use this pattern then I think it takes a total of 4 characters ( 2 number + 1 lowercase + 1 uppercase letter ) to match. Tested Data: Ab45 ->Not Match a4F8-> Not Match What actually happens? What is the meaning of this pattern?
  8. Okay. I already use the following pattern which takes At least two number, one lowercase letter one uppercase letter and at least 8 characters. (?=(.*\d){2})(?=.*[A-z])(?=.*[a-z]).{8,} Means, 4 characters (2 number + 1 lowercase + 1 uppercase letter) are must need and other characters can be anything . Now, I want that other charecter can be anyhthing except number. I replace * with [^0-9]. (?=(.*\d){2})(?=.*[A-Z])(?=.*[a-z])[^0-9]{8,} But, it does't work. Why?
  9. Sir, I want to make another regex that accepts any character at least 8 characters long except (0-9). How to write that? I try it like... [A-z!"#$%&'()*+,-.\/:;<=>?@[\]^_`{|}~]{8,} Can I write this same regexp in another way?
  10. Yes Sir, But in this way, if I want n digits then it needs to right n patterns! Sir, is it possible to do it in any other way?
  11. I try a RegExp for validation which Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters. <input id="name" pattern="(?=.*\d)(?=.*[A-z])(?=.*[a-z]).{8,}"> Now I want to modify it which input must contain two number instead of one number. I tried that like... <input id="name" pattern="(?=.*\d{2})(?=.*[A-z])(?=.*[a-z]).{8,}"> It works fine if I input two numeric digits Consecutive. Mean if I input 87aBcdfgf, then it is right. But 8aBcd7dfg input is wrong. Please, modify my RegExp. which can take input 8aBcd7dfg like that.
×
×
  • Create New...