Guest User

Untitled

a guest
Jul 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. ## Code [javascript]
  2.  
  3. var ImageFullSimpleView = Class.create(AbstractView, {
  4. // View for full size image with only navigation buttons
  5. //
  6. initialize: function($super) {
  7. $super("fullSimple");
  8. },
  9.  
  10. createWidgets: function($super) {
  11.  
  12. // Create widgets
  13. document.write("<div id=\"" + this._name + "_mask\" class=
  14. \"fullMask\"></div>\n");
  15. document.write("<div id=\"" + this._name + "_content\" class=
  16. \"fullContent\">\n");
  17. document.write(" <img id=\"" + this._name + "_image\" class=
  18. \"fullImage\" />\n");
  19. document.write(" <div id=\"" + this._name + "_prevButton\"
  20. class=\"fullPrevButton\"></div>\n");
  21. document.write(" <div id=\"" + this._name + "_nextButton\"
  22. class=\"fullNextButton\"></div>\n");
  23. document.write(" <div id=\"" + this._name + "_hideButton\"
  24. class=\"fullHideButton\"></div>\n");
  25. document.write("</div>\n");
  26.  
  27. // Create bindings for widgets
  28. this.mask = $(this._name + "_mask");
  29. this.content = $(this._name + "_content");
  30. this.image = $(this._name + "_image");
  31. this.prevButton = $(this._name + "_prevButton");
  32. this.nextButton = $(this._name + "_nextButton");
  33. this.hideButton = $(this._name + "_hideButton");
  34.  
  35. // // Create widgets using DOM (doesn't work well with IE)
  36. // this.mask = new Element('div', {'id': this._name + "_mask",
  37. 'class': "fullMask"});
  38. // document.body.appendChild(this.mask);
  39. // this.content = new Element('div', {'id': this._name +
  40. "_content", 'class': "fullContent"});
  41. // document.body.appendChild(this.content);
  42. // this.image = new Element('img', {'id': this._name +
  43. "_image", 'class': "fullImage"});
  44. // this.content.appendChild(this.image);
  45. // this.prevButton = new Element('div', {'id': this._name +
  46. "_prevButton", 'class': "fullPrevButton"});
  47. // this.content.appendChild(this.prevButton);
  48. // this.nextButton = new Element('div', {'id': this._name +
  49. "_nextButton", 'class': "fullNextButton"});
  50. // this.content.appendChild(this.nextButton);
  51. // this.hideButton = new Element('div', {'id': this._name +
  52. "_hideButton", 'class': "fullHideButton"});
  53. // this.content.appendChild(this.hideButton);
  54.  
  55. this.mask.hide();
  56. this.content.hide();
  57. },
  58.  
  59. });
  60.  
  61. ## CSS [css]
  62.  
  63. .fullMask {
  64. position: fixed;
  65. left: 0px;
  66. top: 0px;
  67. width: 100%;
  68. height: 100%;
  69. background-color: black;
  70. opacity: 0.75;
  71. filter: alpha(opacity=75);
  72. z-index: 2;
  73.  
  74. }
  75.  
  76. .fullContent {
  77. position: fixed;
  78. left: 50%;
  79. top: 50%;
  80. z-index: 3;
  81.  
  82. }
  83.  
  84. .fullImage {
  85. border: 10px solid white;
  86. z-index: 4;
  87.  
  88. }
  89.  
  90. /* Common settings for navigation buttons */
  91. .fullPrevButton, .fullNextButton, .fullHideButton {
  92. position: absolute;
  93. height: 100px;
  94. width: 100px;
  95. z-index: 5;
  96. cursor: default;
  97. opacity: 0;
  98. filter: alpha(opacity=0);
  99. background-repeat: no-repeat;
  100. background-position: center center;
  101.  
  102. }
  103.  
  104. .fullPrevButton {
  105. top: 50%;
  106. margin-top: -50px;
  107. right: 50%;
  108. margin-right: 50px;
  109. background-image: url("/icons/default/button-left.png");
  110.  
  111. }
  112.  
  113. .fullNextButton {
  114. top: 50%;
  115. margin-top: -50px;
  116. left: 50%;
  117. margin-left: 50px;
  118. background-image: url("/icons/default/button-right.png");
  119.  
  120. }
  121.  
  122. .fullHideButton {
  123. top: 50%;
  124. margin-top: 25px;
  125. left: 50%;
  126. margin-left: -50px;
  127. background-image: url("/icons/default/button-hide.png");
Add Comment
Please, Sign In to add comment