Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][CSS][JavaScript]wyskakujace okno z podaniem hasla
wytrazek89
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 8.06.2012

Ostrzeżenie: (0%)
-----


Witam mam oto taki kod (lekko po przeróbkach juz)
  1. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  2. <title>Login Modal Dialog Window with CSS and jQuery</title>
  3. <style type="text/css">
  4. body{
  5. background:#202020;
  6. font:bold 12px Arial, Helvetica, sans-serif;
  7. margin:0;
  8. padding:0;
  9. min-width:960px;
  10. color:#bbbbbb;
  11. }
  12.  
  13.  
  14.  
  15.  
  16.  
  17. .container {width: 960px; margin: 0 auto; overflow: hidden;}
  18.  
  19. #content { float: left; width: 100%;}
  20.  
  21. .post { margin: 0 auto; padding-bottom: 50px; float: left; width: 960px; }
  22.  
  23.  
  24.  
  25. .btn-sign a { color:#fff; text-shadow:0 1px 2px #161616; }
  26.  
  27. #mask {
  28. display: none;
  29. background: #000;
  30. position: fixed; left: 0; top: 0;
  31. z-index: 10;
  32. width: 100%; height: 100%;
  33. opacity: 0.8;
  34. z-index: 999;
  35. }
  36.  
  37. .login-popup{
  38. display:none;
  39. background: #333;
  40. padding: 10px;
  41. border: 2px solid #ddd;
  42. float: left;
  43. font-size: 1.2em;
  44. position: fixed;
  45. top: 50%; left: 50%;
  46. z-index: 99999;
  47. box-shadow: 0px 0px 20px #999;
  48. -moz-box-shadow: 0px 0px 20px #999; /* Firefox */
  49. -webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
  50. border-radius:3px 3px 3px 3px;
  51. -moz-border-radius: 3px; /* Firefox */
  52. -webkit-border-radius: 3px; /* Safari, Chrome */
  53. }
  54.  
  55. img.btn_close {
  56. float: right;
  57. margin: -28px -28px 0 0;
  58. }
  59.  
  60. fieldset {
  61. border:none;
  62. }
  63.  
  64. form.signin .textbox label {
  65. display:block;
  66. padding-bottom:7px;
  67. }
  68.  
  69. form.signin .textbox span {
  70. display:block;
  71. }
  72.  
  73. form.signin p, form.signin span {
  74. color:#999;
  75. font-size:11px;
  76. line-height:18px;
  77. }
  78.  
  79. form.signin .textbox input {
  80. background:#666666;
  81. border-bottom:1px solid #333;
  82. border-left:1px solid #000;
  83. border-right:1px solid #333;
  84. border-top:1px solid #000;
  85. color:#fff;
  86. border-radius: 3px 3px 3px 3px;
  87. -moz-border-radius: 3px;
  88. -webkit-border-radius: 3px;
  89. font:13px Arial, Helvetica, sans-serif;
  90. padding:6px 6px 4px;
  91. width:200px;
  92. }
  93.  
  94. form.signin input:-moz-placeholder { color:#bbb; text-shadow:0 0 2px #000; }
  95. form.signin input::-webkit-input-placeholder { color:#bbb; text-shadow:0 0 2px #000; }
  96.  
  97. .button {
  98. background: -moz-linear-gradient(center top, #f3f3f3, #dddddd);
  99. background: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#dddddd));
  100. background: -o-linear-gradient(top, #f3f3f3, #dddddd);
  101. filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f3f3f3', EndColorStr='#dddddd');
  102. border-color:#000;
  103. border-width:1px;
  104. border-radius:4px 4px 4px 4px;
  105. -moz-border-radius: 4px;
  106. -webkit-border-radius: 4px;
  107. color:#333;
  108. cursor:pointer;
  109. display:inline-block;
  110. padding:6px 6px 4px;
  111. margin-top:10px;
  112. font:12px;
  113. width:214px;
  114. }
  115.  
  116. .button:hover { background:#ddd; }
  117.  
  118. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  119. <script type="text/javascript">
  120. $(document).ready(function() {
  121. $('a.login-window').click(function() {
  122.  
  123. // Getting the variable's value from a link
  124. var loginBox = $(this).attr('href');
  125.  
  126. //Fade in the Popup and add close button
  127. $(loginBox).fadeIn(300);
  128.  
  129. //Set the center alignment padding + border
  130. var popMargTop = ($(loginBox).height() + 24) / 2;
  131. var popMargLeft = ($(loginBox).width() + 24) / 2;
  132.  
  133. $(loginBox).css({
  134. 'margin-top' : -popMargTop,
  135. 'margin-left' : -popMargLeft
  136. });
  137.  
  138. // Add the mask to body
  139. $('body').append('<div id="mask"></div>');
  140. $('#mask').fadeIn(300);
  141.  
  142.  
  143. return false;
  144. });
  145. // When clicking on the button close or the mask layer the popup closed
  146. $('a.close, ').live('click', function() {
  147. $('#mask , .login-popup').fadeOut(300 , function() {
  148. $('#mask').remove();
  149. });
  150. return false;
  151. });
  152.  
  153. });
  154. <link rel="canonical" href="http://www.alessioatzeni.com/wp-content/tutorials/jquery/login-box-modal-dialog-window/index.html">
  155. </head>
  156.  
  157. </div>
  158.  
  159.  
  160. <div style="display: block; margin-top: -113px; margin-left: -130px;" id="login-box" class="login-popup">
  161. <a href="#" class="close"><img src="http://serwer0.3te.pl/Pliki_na_strone/obrazki/close_pop.png" class="btn_close" title="Zamknij Okienko" alt="Zamknij Okienko"></a>
  162. <form method="post" class="signin" action="#">
  163. <fieldset class="textbox">
  164.  
  165.  
  166.  
  167. <label class="password">
  168. <span><font color=gold size=3>Podaj Hasło Dostępu Do Logów</font></span>
  169. <center> <br><br> <input id="password" name="password" value="" placeholder="Tu wpisz Hasło" type="password"></center>
  170. </label>
  171.  
  172.  
  173. <p>
  174.  
  175. </p>
  176.  
  177. </form>
  178. </div>
  179.  
  180. </div>
  181. </div>
  182. <div style="display: block;" id="mask"></div></body>
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. </html>




I teraz tak nie wiem jak go przerobić by:
1. po kliknieciu enter (bez uprzedniego podania hasla) nie zamykal mi okna
2. by pobrac to co w input napisal uzytkownik i sprawdzic czy to co napisal jest rowne np "krowa" jesli nie to maly tekst nad polem input ze haslo nie poprawne jesli wpisal krowa to przeniesienie na inny adres www

Kompletnie już nie wiem co robic wiec prosze o jakies wskazowki z góry dziękuje i pozdrawiam
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 26.09.2025 - 12:10