JSFiddle - React, Tailwind, and code Playground

выдвижение блока JQuery

by jurvrn

HTML

<p><button id="button1">1</button></p>
 <p><button id="button2">2</button></p>
		<div id="toggle1"></div>
		</br>
		<div id="toggle2"></div>

CSS

#toggle1 {
  	position: absolute;
    width: 100px;
    height: 100px;
    background: blue;
		right: 0;
  }
	
	  #toggle2 {
  	position: absolute;
    width: 100px;
    height: 100px;
    background: green;
		top: 200px;
		right: 0;
  }

JavaScript

$( "#button1" ).click(function() {
  $( "#toggle1" ).toggle( "slideRight" );
});

$("#button2").click(function(){
  $("#toggle2").animate({left: '250px'});
});