Guest User

Untitled

a guest
Jul 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. $.terabox = function(content){
  2. var terabox = this.terabox, s = terabox.s;
  3. !$("#terabox:visible").length && s.overlay.on && $("#terabox-overlay").css("opacity", 0).show().animate({ opacity: s.overlay.opacity }, s.speed * 0.8);
  4.  
  5. $("#terabox-content").html(content).css("max-height", $(window).height() - 175).parent().css("left", ($(window).width() / 2) - ($("#terabox").outerWidth() / 2)).show();
  6.  
  7. $().trigger("show.terabox");
  8. $().bind("keydown.terabox", function(e){ e.keyCode === 27 && $.terabox.hide(); });
  9. };
  10.  
  11. $.fn.terabox = function(){
  12. $.terabox(this.html());
  13. return this;
  14. };
  15.  
  16. $.terabox.s = { speed: 600, overlay: { opacity: 0.8, on: true } };
  17.  
  18. $.terabox.hide = function(){ $().trigger("hide.terabox"); };
  19.  
  20. $(function(){
  21. $("body").append(
  22. '<div id="terabox" style="width: 500px; position: fixed; top: 50px; display: none; z-index: 999; background-color: white; padding: 10px; border: 10px solid #525252;' +
  23. '-moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px;">' + // epic, epic fail
  24. '<div id="terabox-content" style="overflow: auto;"></div><br>' +
  25. '<div id="terabox-footer" style="text-align: right; border-top: 1px solid #D6D7FF;">' +
  26. '<a href="#" style="font-size: 20px; font-family: Tahoma,Helvetica,Arial,sans-serif; font-weight: bold; color: #7A7A7A; text-decoration: none;' +
  27. 'background: none;">CLOSE</a>' +
  28. '</div>' +
  29. '</div>' +
  30. '<div id="terabox-overlay" style="top: 0; left: 0; width: 100%; height: 100%; position: fixed; display: none; z-index: 998; background-color: black"></div>'
  31. );
  32.  
  33. $().bind("hide.terabox", function(){
  34. $("#terabox").fadeOut($.terabox.s.speed, function(){ $("#terabox-overlay").fadeOut($.terabox.s.speed * 0.8); });
  35. });
  36.  
  37. $("#terabox-footer a, #terabox-overlay").click(function(){ $.terabox.hide(); return false; });
  38. });
Add Comment
Please, Sign In to add comment