Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.78 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3. To change this license header, choose License Headers in Project Properties.
  4. To change this template file, choose Tools | Templates
  5. and open the template in the editor.
  6. -->
  7. <html>
  8.     <head>
  9.     <meta charset="utf-8">
  10.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11.     <meta name="viewport" content="width=device-width, initial-scale=1">
  12.     <title>Pierwszy bootstrap</title>
  13.  
  14.     <!-- Bootstrap -->
  15.     <link href="css/bootstrap.min.css" rel="stylesheet">
  16.     </head>
  17.     <body>
  18.         <div class="container" style="padding: 25px;">
  19.             <h2>Okienko modalne z JQuery</h2>
  20.             <div class="row">
  21.                 <div class="col">
  22.                     <!-- sekcja na wyświetlenie powiekszonych zdjęć -->
  23.                    
  24.                     <section class="modal fade" id="bigPicture">
  25.                         <div class="modal-dialog" style="width: 50%; max-width: 900px;">
  26.                             <div class="modal-content">
  27.                                 <div class="modal-header">
  28.                                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  29.                                     <h4 class="modal-title">Zdjęcie ;)</h4>
  30.                                 </div>
  31.                                 <div class="modal-body">
  32.                                     <img id="bigPicture_img" src="" class="img-responsive">
  33.                                 </div>
  34.                             </div>
  35.                         </div>
  36.                     </section>
  37.                    
  38.                     <!-- zdjęcia zmniejszone -->
  39.                     <div class="miniatury">
  40.                         <!-- wymagany JavaScript do uruchomienia (skrypt nizej) -->
  41.                         <img src="images/o1.jpg" alt="slajd1" width="300">
  42.                         <img src="images/o2.jpg" alt="slajd2" width="300">
  43.                         <img src="images/o6.jpg" alt="slajd3" width="300">
  44.                     </div>
  45.                    
  46.                    
  47.                 </div>
  48.             </div>
  49.         </div>
  50.        
  51.        
  52.        
  53.        
  54.         <script src="js/libs/jquery/jquery.js"></script>
  55.         <script type="text/javascript" src="js/bootstrap.js"></script>
  56.        
  57.         <script>
  58.             $(function(){
  59.                 //klik na miniaturce-pokaż okno modalne
  60.                 $('.miniatury img').on('click',function(){
  61.                     $("#bigPicture").modal( {show:true} );//pobierz okienko modalne i pokaż je
  62.                     //alert(this.src);
  63.                     $("bigPicture_img").attr('src', this.src);
  64.                    
  65.                 });//pokazywanie okna
  66.             });
  67.         </script>
  68.        
  69.     </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement