0
I’m having trouble using the addClass and Remove Class in jQuery. I need the Section of class="" by clicking on it, it disappears and appears to class="video". I need the class "video" to occupy the same space as the class"Lala". ps:(the class "video" cannot appear in html until clicked) Jsfiddle: https://jsfiddle.net/0fdmunoy/1/ THANK YOU <3
$(function() {
$('.bolinha-dentro').click(function(){
$('.bolinha-dentro').removeClass('.bolinha-dentro');
$(this).addClass('for');
});
});
.video.for {
display:block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<section class="lala">
<div class="media3" style="width:57%;display: inline-block;vertical-align: top;padding-left: 60px;padding-top:50px;">
<h2 style="font-size: 16px; color: red; font-weight: bold;padding-bottom:20px;">title for the things we shuld do</h2>
<p style="color: rgb(112, 111, 111); font-size: 16px; font-weight: bold;padding-bottom: 20px;">"Pusing Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here'<strong style="font-size:17px;font-weight: bold;"> "we serve to wudwhq"."</strong> </p>
<h3 class="media4" style="color:#FF0000;font-size:12px;">-GRAG THE PRESIDENT OF THE USA</h3>
</div>
</section>
<div class="video">
<img src="https://as2.ftcdn.net/jpg/00/00/57/35/500_F_573556_fGmwktYr1XKdRjt3iNgydn5kuiNfpc.jpg">
</div>
Tried to use jquery click?
$('.lala').on('click', function () { this.fadeOut() })
– adventistaam
Who is
bolinha-dentro
?– adventistaam
Matheus, I don’t understand what the example code has to do with your problem. I didn’t find the element
.bolinha-dentro
. And could you explain why you want to exchange classes at the same time? There may be another approach to your problem.– fernandosavio
I understand what you want to do, but in the example you used different class names than you need, try to improve your example for the next questions, so it’s easier for the staff to help you.
– Mauro Rocha