Advertisement
metalx1000

Kankun Smart Plug HTML CSS Button Switch Toggle

May 7th, 2015
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.13 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
  4. <script>
  5. $(document).ready(function(){
  6.     $("#switch").click(function(){
  7.         $.post( "/cgi-bin/toggle.cgi", function( data ) {
  8.         console.log(data);
  9.         $("#switch").html(data);       
  10.         });
  11.     });
  12. });
  13. </script>
  14. <style>
  15. .myButton {
  16.     -moz-box-shadow: 3px 4px 0px 0px #1564ad;
  17.     -webkit-box-shadow: 3px 4px 0px 0px #1564ad;
  18.     box-shadow: 3px 4px 0px 0px #1564ad;
  19.     background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5));
  20.     background:-moz-linear-gradient(top, #79bbff 5%, #378de5 100%);
  21.     background:-webkit-linear-gradient(top, #79bbff 5%, #378de5 100%);
  22.     background:-o-linear-gradient(top, #79bbff 5%, #378de5 100%);
  23.     background:-ms-linear-gradient(top, #79bbff 5%, #378de5 100%);
  24.     background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%);
  25.     filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5',GradientType=0);
  26.     background-color:#79bbff;
  27.     -moz-border-radius:5px;
  28.     -webkit-border-radius:5px;
  29.     border-radius:5px;
  30.     border:1px solid #337bc4;
  31.     display:block;
  32.     cursor:pointer;
  33.     color:#ffffff;
  34.     font-family:Arial;
  35.     font-size:100px;
  36.     font-weight:bold;
  37.     padding:200px 40%;
  38.     text-decoration:none;
  39.     text-shadow:0px 1px 0px #528ecc;
  40.     margin-left: auto;
  41.     margin-right: auto;
  42. }
  43. .myButton:hover {
  44.     background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #378de5), color-stop(1, #79bbff));
  45.     background:-moz-linear-gradient(top, #378de5 5%, #79bbff 100%);
  46.     background:-webkit-linear-gradient(top, #378de5 5%, #79bbff 100%);
  47.     background:-o-linear-gradient(top, #378de5 5%, #79bbff 100%);
  48.     background:-ms-linear-gradient(top, #378de5 5%, #79bbff 100%);
  49.     background:linear-gradient(to bottom, #378de5 5%, #79bbff 100%);
  50.     filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#378de5', endColorstr='#79bbff',GradientType=0);
  51.     background-color:#378de5;
  52. }
  53. .myButton:active {
  54.     position:relative;
  55.     top:1px;
  56. }
  57. </style>
  58. </head>
  59. <body>
  60.   <a href="#" id="switch" class="center myButton">Switch</a>
  61. </body>
  62. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement