Advertisement
RUSSEL86

My Custom Popup Area

Aug 8th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 KB | None | 0 0
  1.  
  2. // Image Popup with cross button
  3. ========================================
  4. jQuery(document).ready(function(){
  5. jQuery('button#pop_click').on('click', function(){
  6. jQuery(this).parents('body').find('div.empreendimento_contant_popuparea').addClass('active_pop');
  7. });
  8. jQuery('button#popup_close').on('click', function(){
  9. jQuery(this).parents('div.empreendimento_contant_popuparea').removeClass('active_pop');
  10. });
  11. });
  12.  
  13. -----------------html---------------------
  14. <div class="ampliar_button fix">
  15. <button id="pop_click"></button>
  16. <p>Ampliar planta</p>
  17. </div>
  18. <div class="empreendimento_contant_popuparea fix">
  19. <div class="empreendimento_popup fix">
  20. <button type="button" id="popup_close"><i class="fa fa-times"></i></button>
  21. <img src="<?php echo get_template_directory_uri();?>/img/map.png" alt="" />
  22. </div>
  23. </div>
  24.  
  25. ---------------- css ----------------------
  26. .empreendimento_contant_popuparea{position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;opacity: 0;visibility: hidden;}
  27. .empreendimento_contant_popuparea.active_pop{opacity: 1;visibility: inherit;background: rgba(0, 0, 0, 0.5);z-index: 9;}
  28. #popup_close{position: absolute;right: 0;top: 0;background-color: transparent;}
  29. #popup_close .fa-times{font-size: 23px;background-color: #fff;border-radius: 23px;width: 25px;height: 25px;}
  30. .empreendimento_popup{margin: 5% auto;position: relative;width: 50%;}
  31.  
  32.  
  33. // Contact form Popup with cross button
  34. ========================================
  35. jQuery(document).ready(function(){
  36. jQuery('button#register_update').on('click', function(){
  37. jQuery(this).parents('body').find('div#register_update_content').addClass('active');
  38. });
  39. jQuery('button#register_close, div#register_update_close').on('click', function(){
  40. jQuery(this).parents('div#register_update_content').removeClass('active');
  41. });
  42. });
  43.  
  44. -----------------html---------------------
  45. <button type="button" id="register_update"><h2>Click here for register</h2></button>
  46.  
  47. <div class="register_update_content_area fix" id="register_update_content">
  48. <div id="register_update_close" class="fix"></div>
  49. <div class="register_update_content column fix">
  50. <div class="register_update_content_wrapper fix">
  51. <button type="button" id="register_close"><img src="<?php echo get_template_directory_uri(); ?>/img/week_close.png" alt="" /></button>
  52. <div class="register_update_form fix">
  53. <input type="text" placeholder="השם שלך" class="form_input" />
  54. <input type="text" placeholder="המייל" class="form_input" />
  55. <input type="submit" value="שלח לי עדכונים" class="form_submit" />
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60.  
  61. ---------------- css ----------------------
  62. #register_update{}
  63. .register_update_content_area{position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;opacity: 0;visibility: hidden;}
  64. .register_update_content_area.active{opacity: 1;visibility: inherit;}
  65. #register_update_close{position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.5);z-index: 9; cursor: -webkit-zoom-out;}
  66. .register_update_content{}
  67. .register_update_content_wrapper{position: relative;z-index: 99;margin: 35% 0%;}
  68. button#register_close{background: transparent;padding: 0px;position: absolute;top: -60px;right: 0px;}
  69. button#register_close img{width: 100%;height: auto;display: block;}
  70. button#register_close:focus{box-shadow: 0px 0px 0px 0px #fff;}
  71. .register_update_form{margin: 0% 5%;}
  72. .register_update_form input.form_input{float: right;width: 32%;margin-left: 2%;}
  73. .register_update_form input.form_submit{float: left;width: 32%;}
  74. .register_update_form input.form_submit:hover{background: #fff;}
  75.  
  76. // Map Popup with cross button
  77. ==========================================
  78. jQuery(document).ready(function(){
  79. jQuery('a.mapframe').click(function() {
  80. jQuery(this).parents('div.saopaulo_office_locimg').find('div.mapiframe').addClass('active_iframe');
  81. });
  82. jQuery('button.clos').click(function() {
  83. jQuery(this).parents('div.mapiframe').removeClass('active_iframe');
  84. });
  85. });
  86.  
  87. -------------- this is mark up --------------------------
  88. <a class="mapframe" href="#">
  89. <img src="http://www.cunhapontes.adv.br/wp-content/themes/cunhapontes/img/locatcontato.png" alt="" />
  90. </a>
  91. <div class="mapiframe fix">
  92. <button type="button" class="clos"><i class="fa fa-times"></i></button>
  93. <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3656.8209243190868!2d-46.68858490000003!3d-23.574874199999993!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94ce5772e9e9f0bb%3A0x1a545036d70c75f4!2sAv.+Brg.+Faria+Lima%2C+2012+-+Jardim+Europa%2C+S%C3%A3o+Paulo+-+SP!5e0!3m2!1spt-BR!2sbr!4v1424701769150" width="300" height="150" frameborder="0"></iframe>
  94. </div>
  95. ------------ and this is for style -----------------------
  96. .mapiframe{position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(26, 59, 112, 0.59);z-index: -30;padding: 10%;opacity: 0;}
  97. .mapiframe.active_iframe{opacity: 1;z-index: 9999;}
  98. .mapiframe iframe{width: 100%;height: 450px;background: #fff;padding: 5px;}
  99. button.clos{position: absolute;top: 70px;right: 40px;background: transparent;color: #fff;font-size: 25px;padding: 0px;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement