Advertisement
szymcio93

W3

Jun 16th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. // PRZENOSZENIE NA GÓRE
  2.  
  3. $( document ).ready(function() {
  4. $("h1").click(function(){
  5. $(this).prependTo("body");
  6. });
  7. });
  8.  
  9. //DATA FORMATOWANIE
  10. $( document ).ready(function() {
  11. $("input").keyup(function(){
  12. var date = $(this).val();
  13. var reg = /^(\d{2})[-\/](\d{2})[-\/](\d{4})$/.test(date);
  14. if (reg){
  15. $("div").text("Good Formatting!");
  16. }else
  17. {
  18. $("div").text("BAD JOB");
  19. }
  20. });
  21. });
  22.  
  23. //ZMIANA KOLORU
  24.  
  25. $( document ).ready(function() {
  26. $("h1").click(function(){
  27. $(this).css("color","red");
  28. $("h2, h3").hide();
  29. });
  30. });
  31.  
  32.  
  33. //ASOCJACJA WERSJA OD MAGDY
  34.  
  35. <!DOCTYPE html>
  36. <html>
  37. <head>
  38. <title></title>
  39. </head>
  40. <body>
  41. <div>
  42. {section name=people loop=$osoby}
  43. <table border="1">
  44. {if $smarty.section.people.first}
  45. {foreach from=$osoby[people] key=key item=item1}
  46. <th>{$key}</th>
  47. {/foreach}
  48. <th>ilosc_liter</th>
  49. {/if}
  50. <tr>
  51. <td bgcolor="#EBE8E8">{$osoby[people].imie}</td>
  52. <td bgcolor="#808080">{$osoby[people].nazwisko}</td>
  53. <td bgcolor="#EBE8E8" >{math equation="x + y" x={$osoby[people].imie|count_characters} y={$osoby[people].nazwisko|count_characters}}</td>
  54.  
  55. </tr>
  56. </table>
  57. {/section}
  58. </div>
  59. </body>
  60. </html>
  61.  
  62. //SMARTY OD SZYMONA
  63. <table>
  64. <tr class="first">
  65. <td>lp</td>
  66. <td>name</td>
  67. <td>inhabitants</td>
  68. <td>Ile</td>
  69.  
  70. </tr>
  71. {foreach $osoby as $x}
  72. <tr class="moje"</tr>
  73. <td>{counter}</td>
  74. <td>{$x.imie}</td>
  75. <td>{$x.nazwisko}</td>
  76. <td>{$x.imie|count_characters} + {$x.nazwisko|count_characters}</td>
  77.  
  78. </tr>
  79. {/foreach}
  80. </table>
  81.  
  82. .........................................................
  83.  
  84. <table>
  85. <tr class="first">
  86. <td>name</td>
  87. <td>inhabitants</td>
  88. <td>area</td>
  89. </tr>
  90. {foreach $content as $x}
  91. <tr class="{cycle values="odd,even"}">
  92. <td>{$x->name}</td>
  93. <td>{$x->inhabitants|string_format:"%.2f"}</td>
  94. <td>{$x->area}</td>
  95. </tr>
  96. {/foreach}
  97. </table>
  98.  
  99.  
  100. REGEXPY
  101. ([aąeęioóuy])\w{5}\1 - moja wersja
  102.  
  103. /b([a-z]{5})+/b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement