1 / 15

Podstawy jQuery w aplikacjach ASP.NET Web Forms

Podstawy jQuery w aplikacjach ASP.NET Web Forms. Łukasz Małek, Jakub Maćkiewicz. Czym jest jQuery ?. Główne przyczyny rozwoju jQuery. Źródło: Rafał Jońca - Kurs jQuery. 'Witaj, świecie !'. < html >  < head >  < title >Witaj, świecie</ title > < script type =" text / javascript „

Download Presentation

Podstawy jQuery w aplikacjach ASP.NET Web Forms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Podstawy jQuery w aplikacjach ASP.NET Web Forms Łukasz Małek, Jakub Maćkiewicz

  2. Czym jest jQuery?

  3. Główne przyczyny rozwoju jQuery. Źródło: Rafał Jońca - Kurs jQuery

  4. 'Witaj, świecie!' <html>  <head>  <title>Witaj, świecie</title> <scripttype="text/javascript„ src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <scripttype="text/javascript"> $(document).ready(function() {  $('button').click(function() { alert('Witaj, świecie!'); }); }); </script>  </head>  <body>  <button>Kliknij</button> </body>  </html>

  5. Ukrycie tekstu <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html>

  6. Ukrycie tekstu II <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $(".test").hide(); }); }); </script> </head> <body> <h2 class="test">This is a heading</h2> <p class="test">This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html>

  7. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $(this).hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html> Ukrycie tekstu III

  8. jQueryslideDown <html> <head> <scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#flip").click(function(){ $("#panel").slideDown("slow"); }); }); </script> <style type="text/css"> #panel,#flip { padding:5px; text-align:center; background-color:#e5eecc; border:solid 1px #c3c3c3; } #panel { padding:50px; display:none; } </style> </head> <body> <div id="flip">Kliknij!</div> <div id="panel">Panel został rozsunięty!</div> </body> </html>

  9. jQueryslideUp <html> <head> <scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#flip").click(function(){ $("#panel").slideUp("slow"); }); }); </script> <style type="text/css"> #panel,#flip { padding:5px; text-align:center; background-color:#e5eecc; border:solid 1px #c3c3c3; } #panel { padding:50px; display:yes; } </style> </head> <body> <div id="flip">Kliknij!</div> <div id="panel">Panel został rozsunięty!</div> </body> </html>

  10. jQueryslideToggle <html> <head> <scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#flip").click(function(){ $("#panel"). slideToggle("slow"); }); }); </script> <style type="text/css"> #panel,#flip { padding:5px; text-align:center; background-color:#e5eecc; border:solid 1px #c3c3c3; } #panel { padding:50px; display:none; } </style> </head> <body> <div id="flip">Kliknij!</div> <div id="panel">Panel został rozsunięty!</div> </body> </html>

  11. jQueryFadeIn <html> <head> <scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeIn(); $("#div2").fadeIn("slow"); $("#div3").fadeIn(3000); }); }); </script> </head> <body> <button>Kliknij!</button> <br><br> <div id="div1" style="width:80px;height:80px;display:none;background-color:red;"></div><br> <div id="div2" style="width:80px;height:80px;display:none;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;display:none;background-color:blue;"></div> </body> </html>

  12. jQueryFadeOut <html> <head> <scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeOut(); $("#div2").fadeOut("slow"); $("#div3").fadeOut(3000); }); }); </script> </head> <body> <button>Kliknij!</button> <br><br> <div id="div1" style="width:80px;height:80px;display:yes;background-color:red;"></div><br> <div id="div2" style="width:80px;height:80px;display:yes;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;display:yes;background-color:blue;"></div> </body> </html>

  13. jQueryfadeToggle <html> <head> <scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeTo("slow",0.05); $("#div2").fadeTo("slow",0.4); $("#div3").fadeTo("slow",0.9);}); }); </script> </head> <body> <button>Kliknij!</button> <br><br> <div id="div1" style="width:80px;height:80px;display:yes;background-color:red;"></div><br> <div id="div2" style="width:80px;height:80px;display:yes;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;display:yes;background-color:blue;"></div> </body> </html>

  14. jQueryfadeToggle <html> <head> <scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1"). fadeToggle(); $("#div2"). fadeToggle("slow"); $("#div3"). fadeToggle(3000); }); }); </script> </head> <body> <button>Kliknij!</button> <br><br> <div id="div1" style="width:80px;height:80px;display:yes;background-color:red;"></div><br> <div id="div2" style="width:80px;height:80px;display:yes;background-color:green;"></div><br> <div id="div3" style="width:80px;height:80px;display:yes;background-color:blue;"></div> </body> </html>

  15. Główne zalety korzystania z jQuery Źródło: Rafał Jońca - Kurs jQuery

More Related