Advertisement
Guest User

Untitled

a guest
Jan 11th, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  4. <title>Demo</title>
  5. <script src="lib/jquery.js"></script>
  6. <body>
  7.     <style>
  8.         .element {
  9.             background: #555;      
  10.             padding: 5px;            
  11.             border-radius: 2px;
  12.             color: #fff;
  13.             font-size: 14px;
  14.             font-weight: bold;
  15.             text-align: center;
  16.             cursor: pointer;
  17.             width: 100px;
  18.             border: 1px solid steelBlue;
  19.             margin-top: 10px;
  20.             position: static;      
  21.         }
  22.         .wrap:hover {
  23.             opacity: 0.9;
  24.         }        
  25.         .block {
  26.             background: #ccc;
  27.             border-radius: 5px;
  28.             color: #000;
  29.             font-size: 12px;
  30.             padding: 5px;
  31.             #opacity: 0;
  32.             width: 250px;
  33.             position: absolute;        
  34.             left: 160px;
  35.             #top: 38px;
  36.             height: 160px;
  37.             display: none;                        
  38.         }
  39.         .block textarea {
  40.             max-width: 240px;
  41.             min-width: 240px;
  42.             border-radius: 3px;
  43.             min-height: 120px;
  44.             max-height: 120px;
  45.         }
  46.         .block .saveBtn {
  47.             float: left;
  48.         }      
  49.         .block .closeBtn {
  50.             float: right;
  51.         }  
  52.         #content {
  53.             width: 500px;
  54.             background: #ebebeb;
  55.             padding: 20px;            
  56.             border: 1px solid steelBlue;
  57.         }
  58.     </style>
  59.     <script>
  60.         $(document).ready(function() {                            
  61.             showBlock();            
  62.             hideBlock();
  63.         });
  64.  
  65.         function showBlock() {                    
  66.             $('.element').click(function() {  
  67.                 $(this).next().fadeIn('medium');
  68.             });
  69.         }
  70.  
  71.         function hideBlock() {                        
  72.             $('.closeBtn').click(function() {                
  73.                 $(this).parent().fadeOut('medium');
  74.             });
  75.         }
  76.     </script>
  77.     <div id="content">
  78.        
  79.             <div class="element">Button 1</div>
  80.             <div class="block" style="top:38px">
  81.                 <textarea></textarea>
  82.                 <button class="saveBtn">Save</button>
  83.                 <button class="closeBtn">Close</button>
  84.             </div>
  85.                
  86.             <div class="element">Button 2</div>
  87.             <div class="block" style="top:78px">
  88.                 <textarea></textarea>
  89.                 <button class="saveBtn">Save</button>
  90.                 <button class="closeBtn">Close</button>
  91.             </div>
  92.                
  93.             <div class="element">Button 3</div>
  94.             <div class="block" style="top:118px">
  95.                 <textarea></textarea>
  96.                 <button class="saveBtn">Save</button>
  97.                 <button class="closeBtn">Close</button>
  98.             </div>
  99.        
  100.     </div>
  101. </body>
  102. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement