Advertisement
noctual

fancybox

May 29th, 2021
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.19 KB | None | 0 0
  1. <html>
  2. <head>
  3.   <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.css">
  4.   <style>
  5.     #modal, #modal2 {
  6.         display: none;
  7.         width: 100%;
  8.         max-width: 600px;
  9.         padding: 0 0 40px 0;
  10.         text-align: justify;
  11.         border-radius: 3px;
  12.         box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  13.     }
  14.   </style>
  15. </head>
  16. <body>
  17.  
  18.     <a data-fancybox data-touch="false" href="#modal" class="btn btn-primary">Open demo</a>
  19.    
  20.     <div id="modal">
  21.         <button id="btn">открыть окно 2</button>
  22.     </div>
  23.      
  24.     <div id="modal2">
  25.         окно 2
  26.     </div>
  27.  
  28.     <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
  29.     <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.js"></script>
  30.     <script>
  31.         $(function(){
  32.             $("#btn").on('click', function(){
  33.                 $.fancybox.close()
  34.                 $.fancybox.open({
  35.                     src: '#modal2',
  36.                     type: 'inline',
  37.                 });
  38.             })
  39.         });
  40.     </script>
  41.  
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement