elsaofarendelle

popup tabs

Jan 16th, 2017 (edited)
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.89 KB | None | 0 0
  1. <! --- paste below <head> --- >
  2.  
  3. <script type="text/javascript"
  4. src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
  5. <script>
  6. $(document).ready(function() {
  7. //
  8. $('a.poplight[href^=#]').click(function() {
  9. var popID = $(this).attr('rel'); //Get Popup Name
  10. var popURL = $(this).attr('href'); //Get Popup href to define size
  11. var query= popURL.split('?');
  12. var dim= query[1].split('&');
  13. var popWidth = dim[0].split('=')[1]; //Gets the first query string value
  14. $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"></a>');
  15. var popMargTop = ($('#' + popID).height() + 80) / 2;
  16. var popMargLeft = ($('#' + popID).width() + 80) / 2;
  17. //Apply Margin to Popup
  18. $('#' + popID).css({
  19. 'margin-top' : -popMargTop,
  20. 'margin-left' : -popMargLeft
  21. });
  22. $('body').append('<div id="fade"></div>');
  23. $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'})
  24. return false;
  25. });
  26. $('a.close, #fade').live('click', function() {
  27. $('#fade , .popup_block').fadeOut(function() {
  28. $('#fade, a.close').remove(); //fade them both out
  29. });
  30. return false;
  31. });
  32. });
  33. </script>
  34.  
  35. <script>
  36.  
  37. $(document).ready(function(){
  38. $("ul#tabs li").click(function(e){
  39. if (!$(this).hasClass("active")) {
  40. var tabNum = $(this).index();
  41. var nthChild = tabNum+1;
  42. $("ul#tabs li.active").removeClass("active");
  43. $(this).addClass("active");
  44. $("ul#tab li.active").removeClass("active");
  45. $("ul#tab li:nth-child("+nthChild+")").addClass("active");
  46. }
  47. });
  48. });
  49. </script>
  50.  
  51. /* --- PASTE AFTER <style type="text/css"> --- */
  52.  
  53. /* --- MENU START --- */
  54.  
  55. .popup_block{
  56. display:none;
  57. background: url("");
  58. background:#fff;
  59. padding:20px;
  60. border:1px solid #eeeff2;
  61. float:left;
  62. height:317px;
  63. top:75%; left:57%;
  64. position:fixed;
  65. z-index: 99999;
  66. -webkit-box-shadow: none;
  67. -moz-box-shadow: none;
  68. box-shadow: none;
  69. }
  70.  
  71.  
  72. *html #fade {position: absolute;}
  73. *html .popup_block {position: absolute;}
  74. #fade {
  75. display:none;
  76. position:fixed;
  77. left:0px;
  78. top:0px;
  79. width:100%;
  80. height:100%;
  81. z-index:9999;
  82. background: none;
  83. opacity: none;
  84. }
  85.  
  86. #popheaders{
  87. width:300px;
  88. height:auto;
  89. padding:10px;
  90. font-size:15px;
  91. text-transform:normal;
  92. letter-spacing:1px;
  93. color:#fff;
  94. font-family: 'Dancing Script', cursive;
  95. text-shadow:0px 0px 5px #000;
  96. border: 3px double #fff;
  97. background: url('https://i.imgur.com/5L1kSTE.png');
  98. line-height:30%;
  99. }
  100.  
  101. #popuptext {
  102. margin-top:-12px;
  103. margin-left:-15px;
  104. width:400px;
  105. height:293px;
  106. font-family: 'Scheherazade', serif;
  107. font-size:12px;
  108. color:#919191;
  109. overflow:scroll;
  110. text-align:justify;
  111. position:fixed;
  112. overflow-y padding:20px;
  113. }
  114.  
  115. .poplinks {
  116. padding-top:5px;
  117. text-align:center;
  118. }
  119.  
  120.  
  121. .poplinks a {
  122. display:inline-block;
  123. width:120px; height:8px;
  124. margin:2px; padding:6px 6px 10px;
  125. text-align:center;
  126. font-family:'helvetica';
  127. font-size:11px;
  128. text-transform:uppercase;
  129. letter-spacing:1px;
  130. color:#eee; background:transparent;
  131. background-image:url('');
  132. border:1px dotted #eee;
  133. }
  134.  
  135. .poplinks a:hover {
  136. display:inline-block;
  137. width:120px; margin:2px;
  138. padding:6px 6px 10px;
  139. text-align:center;
  140. font-family:times;
  141. font-size:11px;
  142. text-transform:normal;
  143. letter-spacing:1px;
  144. color:#eee;
  145. background:transparent
  146. }
  147.  
  148. .buttons a {
  149. text-decoration:none;
  150. background: #fafafa;
  151. border:1px solid #919191;
  152. padding:10px;
  153. width:50px;
  154. margin-top:3px;
  155. margin-left:5px;
  156. display:inline-block;
  157. color:#fff;
  158. text-align:center;
  159. }
  160.  
  161. .butons a:hover {
  162. background:#053355;
  163. background: #fafafa;
  164. border:1px solid #919191;
  165. color:#fff;
  166. -webkit-transition: all 0.3s ease-in-out;
  167. -moz-transition: all 0.3s ease-in-out;
  168. -o-transition: all 0.3s ease-in-out;
  169. -ms-transition: all 0.3s ease-in-out;
  170. transition: all 0.3s ease-in-out;
  171. }
  172.  
  173. ul#tabs {
  174. list-style-type: none;
  175. padding: 0;
  176. text-align: center;
  177. font-size: 11px;
  178. letter-spacing:1px;
  179. }
  180.  
  181. ul#tabs li {
  182. display: inline-block;
  183. background-color: transparent;
  184. border: 1px solid #eee;
  185. padding: 4px 12px;
  186. margin-bottom: 4px;
  187. color: #a4a4a4;
  188. cursor: pointer;
  189. }
  190.  
  191. ul#tabs li:hover {
  192. background-color: #eee;
  193. }
  194.  
  195. ul#tabs li.active {
  196. background-color: #eee;
  197. color: #eee;
  198. background-image:url('https://i.imgur.com/5L1kSTE.png');
  199. border: 1px solid #a4a4a4;
  200. }
  201.  
  202. ul#tab {
  203. list-style-type: none;
  204. margin: 0;
  205. padding: 0;
  206. }
  207.  
  208. ul#tab li {
  209. display: none;
  210. }
  211.  
  212. ul#tab li.active {
  213. display: block;
  214. }
  215.  
  216. a:link, a:active, a:visited {
  217. text-decoration: none;
  218. color: #919191;
  219. -moz-transition-duration:.6s;
  220. -webkit-transition-duration:.6s;
  221. -o-transition-duration:.6s;
  222. }
  223.  
  224. a:hover {
  225. color: #919191;
  226. -moz-transition-duration:.6s;
  227. -webkit-transition-duration:.6s;
  228. -o-transition-duration:.6s;
  229. }
  230.  
  231. /* --- MENU END --- */
  232.  
  233.  
  234. <a title="menu" href="#?w=370" rel="box1" class="poplight"><img src="https://i.imgur.com/lMEGVDy.png"></a>
  235.  
  236. <div id="box1" class="popup_block">
  237.  
  238. <ul id="tabs">
  239. <li class="active">Tab 1</li>
  240. <li>Title 2</li>
  241. <li>Tab 3</li>
  242. <li>Tab 4</li>
  243. <li>Tab 5</li>
  244. </ul>
  245.  
  246. <div style="width:auto;height:335px;overflow:scroll;padding:5px;">
  247.  
  248.  
  249.  
  250. <ul id="tab">
  251. <li class="active">
  252. <div id="popuptext">
  253. <center><div id="popheaders">Title</div></center>
  254. <p>Text Here</p>
  255.  
  256. <center><div id="popheaders">Title</div></center>
  257. <p>Text Here</p>
  258.  
  259. </li>
  260. <li>
  261.  
  262.  
  263. <div id="popuptext">
  264. <center><div id="popheaders">Title</div></center>
  265. <p>Text Here</p>
  266.  
  267. <center><div id="popheaders">Title</div></center>
  268. <p>Text Here</p>
  269.  
  270. </li>
  271. <li>
  272.  
  273. <div id="popuptext">
  274. <center><div id="popheaders">Title</div></center>
  275. <p>Text Here.</p>
  276. <center><div id="popheaders">Title</div></center>
  277. <p>Text Here.</p>
  278.  
  279. </li>
  280. <li>
  281.  
  282. <div id="popuptext">
  283. <center><div id="popheaders">Title</div></center>
  284. <p>Text Here</p>
  285.  
  286.  
  287. </li>
  288. <li>
  289.  
  290. <table>
  291. <tr>
  292. <td>
  293. <div class="buttons">
  294. <a href="/">LINK</a>
  295. <a href="/">LINK</a>
  296. <a href="/">LINK</a>
  297. <a href="/">LINK</a>
  298. <a href="/">LINK</a>
  299. <a href="/">LINK</a>
  300. <a href="/">LINK</a>
  301.  
  302. </div>
  303. </td>
  304. <td>
  305.  
  306. <div class="buttons">
  307.  
  308. <a href="/">LINK</a>
  309. <a href="/">LINK</a>
  310. <a href="/">LINK</a>
  311. <a href="/">LINK</a>
  312. <a href="/">LINK</a>
  313. <a href="/">LINK</a>
  314. <a href="/">LINK</a>
  315.  
  316. </div>
  317.  
  318. </td>
  319. <td>
  320.  
  321. <div class="buttons">
  322.  
  323. <a href="/">LINK</a>
  324. <a href="/">LINK</a>
  325. <a href="/">LINK</a>
  326. <a href="/">LINK</a>
  327. <a href="/">LINK</a>
  328. <a href="/">LINK</a>
  329. <a href="/">LINK</a>
  330.  
  331. </div>
  332.  
  333. </td>
  334. <td>
  335.  
  336. <div class="buttons">
  337.  
  338. <a href="/">LINK</a>
  339. <a href="/">LINK</a>
  340. <a href="/">LINK</a>
  341. <a href="/">LINK</a>
  342. <a href="/">LINK</a>
  343. <a href="/">LINK</a>
  344. <a href="/">LINK</a>
  345.  
  346. </div>
  347.  
  348. </td>
  349. </tr>
  350. </table>
  351. </div>
  352. </li>
  353. <li>
  354.  
  355. </div>
  356. </div>
Advertisement
Add Comment
Please, Sign In to add comment