Advertisement
artsja

Disclaimers

Jan 14th, 2017
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. --------------------- VERSION 1 (open/close) ---------------------
  2.  
  3.  
  4. <a href="javascript:;" onmousedown="if(document.getElementById('disclaimer').style.display == 'none') { document.getElementById('disclaimer').style.display = 'block'; } else { document.getElementById('disclaimer').style.display = 'none'; }">disclaimer</a>
  5. <div id="disclaimer" style="display:none">disclaimer text goes here</div>
  6.  
  7.  
  8. <style> #disclaimer{width:250px; text-align:left; padding:20px; background: rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.5); border-radius:10px; font-size:10px; transition:all 1s} </style>
  9.  
  10. --------------------- VERSION 2 (on hover) ---------------------
  11.  
  12.  
  13. <a class="info" href="#">disclaimer<span> disclaimer text goes here </span></a>
  14.  
  15.  
  16. <style> a.info { position:relative; z-index:24; text-decoration:none } a.info:hover { z-index:25; } a.info span { display: none; } a.info:hover span { display:block; position:absolute; top:2em; left:-2em; width:250px; background: rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.5); border-radius:10px; font-size:10px; padding:20px} </style>
  17.  
  18.  
  19. --------------------- VERSION 3 (opacity) ---------------------
  20.  
  21.  
  22. <a href="javascript:;" onmousedown="if(document.getElementById('disclaimer2').style.opacity == '0') { document.getElementById('disclaimer2'). style.opacity = '1'; } else { document.getElementById('disclaimer2'). style.opacity = '0'; }">disclaimer</a>
  23. <div id="disclaimer2" style="opacity:0">disclaimer text goes here</div>
  24.  
  25.  
  26. <style> #disclaimer2{width:250px; text-align:left; padding:20px; background: rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.5); border-radius:10px; font-size:10px; transition:all 1s} </style>
  27.  
  28.  
  29. --------------------- VERSION 4 (height) ---------------------
  30. --- IMPORTANT: "style.height = '60px';" must be the same height as #disclaimer3 height for accurate transitions! ---
  31.  
  32.  
  33. <a href="javascript:;" onmousedown="if(document.getElementById('discwrapper'). style.height == '0px') { document.getElementById('discwrapper'). style.height = '60px'; } else { document.getElementById('discwrapper'). style.height = '0px'; }">disclaimer</a>
  34. <div id="discwrapper" style="height:0px;overflow:hidden;"><div id="disclaimer3" style="display:block">disclaimer text goes here</div></div>
  35.  
  36. <style> #disclaimer3{width:250px; text-align:left; padding:20px; background: rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.5); border-radius:10px; font-size:10px; transition:all 1s} #discwrapper{transition:height 2s}</style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement