I would like it to click on the contents, it disappears smoothly and shows the other content.
Just the way I'm doing, it pops up, disappears, and appears.
var codigo = 0;
$('.btn-news').on('click', function () {
var news = $('.noticias');
var id = $(this).data('id');
codigo = id;
switch (codigo){
case 1:
news.fadeOut();
news.html('<p style="margin: 1rem 2rem"> Lorem Ipsum é simplesmente .</p>').fadeIn()
break;
case 2:
news.fadeOut();
news.html(
'<p style="margin: 1rem 2rem">É um fato conhecido de todos .</p>').fadeIn();
break;
}
});
<!doctype html>
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script></head><body><divclass="col-lg-12">
<div class="col-lg-7"></div>
<div class="col-lg-1" ></div>
<div class="col-lg-4" ><b>Úlimas Notícias</b></div>
<div class="col-lg-7" style="border: 1px solid #ccc">
<div class="noticias">
</div>
</div>
<div class="col-lg-1" style="width: 1px;"></div>
<div class="col-lg-4" style="border: 1px solid #ccc">
<ul>
<li><a href="#" data-id="1" class="btn-news">Noticia 1</a></li>
<li><a href="#" data-id="2" class="btn-news">Noticia 2</a></li>
</ul>
</div>
</div>
</body>
</html>