klon

In this example below you will see how to do a klon with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by Ferencok, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Ferencok ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>klon</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <button class="klon">clone Add to cart</button> 
<button class="klon1">clone add to cart</button> 

<div class="a1" >
<button class="a1btn">Zavriet</button>
  <button class="red"></button>
<div class="deti"></div>
</div>

<p class="2"><img src="http://lorempixel.com/200/200/city" style="float:left;"/></p>
<p class="1"><img src="http://lorempixel.com/200/200" style="float:left;"/>This is a ewewew  paragraph.</p>


<p><input style="" id="append" type="button" value="append to"></p>
<span id="span"> Peter </span>
<p id="para">Volam sa: </p>


<button class="infoBtn">cart</button>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/Ferencok/klon-mPvzXg */
.a1{
  background: aqua;
  display: block;
  width: 30%;
  float: left;
  display: none;
  margin: 15px;
  padding: 10px;
}
button{
  padding: 5px;
  font-size:1em;
  line-height: 1.2em;
  border-radius: 3px;
}
.red{
  width:4px;
  background: red;
  line-height: 10px;
  display: block;
}
.deti{
  width:150px;
  height: 100px;
}
img{
  margin: 10px;
}

#menu {
    display: none;
    width: 150px;
    height: 200px;
    background: #ccc;
    border-radius: 15px 0px 0px 15px;
    float: right;
}
#toggle{
  float:right;
  width: 30%;
  margin: 10px;}
  

/*Downloaded from https://www.codeseek.co/Ferencok/klon-mPvzXg */
$(document).ready(function(){
  $(".klon").click(function(){
     $('.2').clone().appendTo('.deti')
    
  });
});

$(document).ready(function(){
  $(".klon1").click(function(){
     $('.1').clone().appendTo('.deti')
    
  });
});

$('#append').click(function(){
   $('#span').clone().appendTo('#para')
  
});



$('.info').click(function() {
    $('.infoBlock').slideToggle("slow");
});

$('.infoBtn').click(function(){
  $('.a1').slideToggle("slow");
  });

$('.a1btn').click(function(){
    $('.deti').children().remove();
 });

$('.red').click(function(){
  $('.a1').fadeOut("slow");
  });

$("#toggle").click(function () {
    $("#menu").toggle('slide', { direction: 'right' }, 1000);
});

Comments