Guest User

Untitled

a guest
Aug 19th, 2019
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Add your JavaScript code here.
  2.  
  3. If you are using the jQuery library, then don't forget to wrap your code inside jQuery.ready() as follows:
  4.  
  5. jQuery(document).ready(function( $ ){
  6. // Your code in here
  7. });
  8.  
  9. --
  10.  
  11. If you want to link a JavaScript file that resides on another server (similar to
  12. <script src="https://example.com/your-js-file.js"></script>), then please use
  13. the "Add HTML Code" page, as this is a HTML code that links a JavaScript file.
  14.  
  15. End of comment */
  16.  
  17. jQuery(document).ready(function($){
  18. $('#page').append('<div class="mobile-caller">'
  19. + '<img src="https://iphonelodz.pl/wp-content/uploads/2018/05/phone2.png" />'
  20. + '</div>'
  21. + '<div class="phones-overlay">'
  22. + '<div class="phones-holder">'
  23. + '<div class="phones-list">'
  24. + '<ul>'
  25. + '<li class="title">'
  26. + '<div class="left"><img src="https://iphonelodz.pl/wp-content/uploads/2018/05/phone.png" /></div>'
  27. + '<div class="right">'
  28. + '<p><span>Zadzwoń</span> komórka</p>'
  29. + '</div>'
  30. + '</li>'
  31. + '<a href="tel:+48606115113">'
  32. + '<li class="number">'
  33. + '<div class="left"></div>'
  34. + '<div class="right">'
  35. + '<span>ul. Wydawnicza (Łódź Widzew)</span>'
  36. + '<p>606 115 113</p>'
  37. + '</div>'
  38. + '</li>'
  39. + '</a>'
  40. + '<a href="tel:+48606508580">'
  41. + '<li class="number">'
  42. + '<div class="left"></div>'
  43. + '<div class="right">'
  44. + '<span>ul. Obywatelska (Łódź Polesie)</span>'
  45. + '<p>606 508 580</p>'
  46. + '</div>'
  47. + '</li>'
  48. + '</a>'
  49. + '<a href="tel:+48606704102">'
  50. + '<li class="number">'
  51. + '<div class="left"></div>'
  52. + '<div class="right">'
  53. + '<span>ul. Marysińska (Łódź Bałuty)</span>'
  54. + '<p>606 704 102</p>'
  55. + '</div>'
  56. + '</li>'
  57. + '</a>'
  58. + '</ul>'
  59. + '</div>'
  60. + '<div class="cancel">'
  61. + '<p>Anuluj</p>'
  62. + '</div>'
  63. + '</div>'
  64. + '</div>');
  65.  
  66. function toggle(e){
  67. console.log('tiglitigligit');
  68. $('.phones-holder').slideToggle();
  69. $('.phones-overlay').slideToggle();
  70. $('.mobile-caller').slideToggle();
  71. e.preventDefault();
  72. e.stopPropagation();
  73. }
  74.  
  75. $('.mobile-caller').click(function(e) {
  76. toggle(e);
  77. });
  78. $('.cancel').click(function(e){
  79. toggle(e);
  80. });
  81. $('.phones-overlay').click(function(e){
  82. toggle(e);
  83. });
  84. $('.phones-holder').click(function(e){
  85. e.stopPropagation();
  86. });
  87. });
RAW Paste Data