Advertisement
kocmo7

Jquery 23.05

May 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.39 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3.     <head   >
  4.             <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
  5.            <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
  6.             <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  7.             <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
  8.             <script src="js/js.js"></script>
  9.             <link href="css/style.css" type="text/css" rel="stylesheet">
  10.            
  11.     </head>
  12.  
  13.  
  14.     <body >
  15.        
  16.        
  17.        
  18.     <div class="container">
  19.        
  20.             <div id="myImg" >
  21.                     <img alt="Image" src="res/image2.jpg" id="myImg2"> 
  22.                     <img alt="Image" src="res/image.jpg" id="myImg1">
  23.             </div>
  24.            
  25.         <br><br>   
  26.        
  27.         <div class="januralClass" >            
  28.             <h2 id="Orange123">First block</h2>
  29.             <ul>
  30.                 <li>Some text Some text Some text Some text Some text</li>
  31.                 <li>Some text Some text Some text Some text Some text</li>
  32.                 <li>Some text Some text Some text Some text Some text</li>
  33.                 <li>Some text Some text Some text Some text Some text</li>
  34.             </ul>
  35.         </div>
  36.  
  37.        
  38.        
  39.         </div>
  40.    <br>  
  41.      
  42.      
  43.      <div id="someText" >
  44.             <p id="textToChange1">Text Text Text Text Text Text Text Text Text </p>
  45.             <p id="textToChange2">AAaa AAaa AAaa AAaa AAaa AAaa AAaa AAaa AAaa </p>
  46.                    
  47.             </div>
  48.        
  49.        
  50.        
  51.    <br>  
  52.    
  53.     <input type="button" id="FirstBtn" value="Orange button" class="btn"><br>   <br>   
  54.     <input type="button" id="SecondBtn" value="Click me" class="btn">
  55.     </body>
  56. </html>
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. js
  64.  
  65.  
  66. $(document).ready(function(){
  67.    
  68.      $("#FirstBtn").click( function() {$("#Orange123").css({"color":"orange"}); });//Change text to orange
  69.      
  70.      $("#SecondBtn").click( function() {$("#SecondBtn").animate({  //Change size of button
  71.          
  72.                         left: '500px',
  73.             opacity: '1',
  74.             height: '150px',
  75.             width: '150px'
  76.                        
  77.          
  78.          }); });
  79.          
  80.              $("#SecondBtn").click( function() {$("#SecondBtn").animate({  //Change size of button
  81.          
  82.                         left: '20px',
  83.             opacity: '1',
  84.             height: '50px',
  85.             width: '80px'
  86.                        
  87.          
  88.          }); });
  89.  
  90.          
  91.          
  92.          
  93.          
  94.  
  95.      $("#myImg").click( function() {  // picture change to picture alse
  96.          
  97.                     $(this).find("img","last").fadeToggle();
  98.          
  99.          });
  100.          
  101.          
  102.          $("p").click(function(){   // hide paragraph and change him
  103.         $(this).hide();
  104.     });
  105.        
  106.        
  107.         $("#someText").click( function() {  
  108.          
  109.                     $(this).find("p","last").fadeToggle();
  110.          
  111.          });
  112.        
  113.      
  114.  
  115. });
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. css
  125.  
  126.  
  127. .januralClass{
  128.         border-style: solid;
  129.     border-width: 2px;
  130.         border-color:black;
  131.         width:450px;
  132.         height:300px;  
  133.        
  134. }
  135.  
  136. h2{
  137.     text-align:center;
  138.    
  139. }
  140. #myImg1{
  141.    
  142.     top:0;
  143.     left:0;
  144.     width:50%;
  145.    
  146. }
  147.  
  148. #myImg2{
  149.    
  150.     top:0;
  151.     left:0;
  152.     width:50%;
  153.     display:none;
  154. }
  155. body{
  156.     position:absolute;
  157. }
  158.  
  159. #textToChange1{
  160.     display:none;
  161. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement