Animate function in asp.net 4.0 Use Jquery.

Animate function in asp.net 4.0 Use Jquery.
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4. <html xmlns="http://www.w3.org/1999/xhtml">  
  5. <head id="Head1" runat="server">  
  6. <title></title>  
  7. <style type="text/css">  
  8. .contentarea  
  9. {  
  10. width:300px;  
  11. height:250px;  
  12. font-size:16px;  
  13. border:5px solid red;  
  14. background:#ccc666;  
  15. color:#000000;  
  16. }  
  17. </style>  
  18. <script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>  
  19. <script language="javascript" type="text/javascript">  
  20. $(document).ready(function () {  
  21. var regular = true;  
  22. $("#<%=btnsubmit.ClientID %>").click(function (e) {  
  23. e.preventDefault();  
  24. if (regular == true) {  
  25. $(".contentarea").animate({  
  26. opacity: 0.5,  
  27. width: "500px",  
  28. height: "280px",  
  29. fontSize: "42px",  
  30. borderwidth: "15px"  
  31. }, "slow");  
  32. }  
  33. else {  
  34. $(".contentarea").animate({  
  35. opacity: 0.5,  
  36. width: "300px",  
  37. height: "100px",  
  38. fontSize: "16px",  
  39. borderwidth: "55px"  
  40. }, "slow");  
  41. }  
  42. regular = !regular;  
  43. });  
  44. });  
  45. </script>  
  46. </head>  
  47. <body>  
  48. <form id="form1" runat="server">  
  49. <fieldset id="field1" runat="server" title="Animated panal">  
  50. <asp:Button ID="btnsubmit" runat="server" Text="Animate" />  
  51. <br />  
  52. <br />  
  53. <asp:Panel ID="Panel1" runat="server" CssClass="contentarea">  
  54. I am Dipankar Biswas  
  55. </asp:Panel>  
  56. </fieldset>  
  57. </form>  
  58. </body>  
  59. </html> 
 
 
 

Button click
 
 
Ebook Download
View all
Learn
View all