Jump to content
×
×
  • Create New...

Lorem Ipsum is simply dummy text

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

Test Test

Lorem Ipsum is simply dummy text

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

Test Test

Lorem Ipsum is simply dummy text

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

Test Test

Lorem Ipsum is simply dummy text

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

Test Test

Lorem Ipsum is simply dummy text

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

Test Test

  • Bu Alana Reklam Verebilirsiniz
    Bu Alana Reklam Verebilirsiniz

Checkbox İle Resim Gizleme Örneği Kodları | jQuery

Rate this topic


programYaz
 Share


Recommended Posts

Checkbox İle Resim Gizleme Örneği Kodları | jQuery
 Share


  • Members

Bu yazımızda jQuery ile checkbox kullanımını gösteren basit bir örnek gerçekleştireceğiz. Örneğimizde sayfamıza eklenen resmin checkbox seçili iken sayfamızda görüntülenmesini, seçili değil iken ise gizlenmesini sağlayacağız. Gizleme ve görüntüleme işlemini slideUp ve slideDown metotlarını kullanarak animasyonlu bir şekilde oluşturacağız.

 

jquery-checkbox-kullanimi-2.gif?resize=8

 

Kodarımızı checkbox kontrolünün change olayını kullanarak yazacağız.

 

.html sayfasına ait kodlar:

<!DOCTYPE html>
<html lang="">
<head>
  <meta charset="utf-8">
  <title>Jquery Örnekler</title>
  <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
 
  <style>
      #kutu1{
          height: 250px;
      }  
      img{
          height: 230px;
      }
  </style>
 
</head>
 
<body>
<div id="kutu1">
    <img src="resim/4.png" id="resim">
</div>
<div id="kutu2">
    <input type="checkbox" id="chk" checked> Resmi Göster
</div>
 
 
 
  <script>
    //Onay kutusu onaylandığında resim görünsün onayı kaldırıldığında resim görünmesin
    $(document).ready(function() {
      $("#chk").on("change",function(){
        if($(this).prop("checked")==true){
           $("#resim").slideDown(2000);
        }else{
           $("#resim").slideUp(2000);
        }
      });
    });
  </script>
</body>
</html>
 

 

Ada LoveLace

Link to comment
Share on other sites


Konu Altı Reklam 1
Konu Altı Reklam 2
  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...