Utilizing jQuery offers a wide range of possibilities to achieve the desired effect, such as using the .slideUp
method.
$("#1").fadeTo(1000, 500).slideUp(500, function() {
$("#1").slideUp(500);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="col-md-4">
<div class="cont">
<h1 id="1"> title 1 </h1>
<h1> title 2 </h1>
</div>
</div>
To apply this effect to all h1
elements, you can use .getElementsByTagName()
, but keep in mind that this will be applied to all of them. It is recommended to still use the same class on all elements for better control :)
var h1 = document.getElementsByTagName("h1");
$(h1).fadeTo(1000, 500).slideUp(500, function() {
$(h1).slideUp(500);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js></script>
<div class="col-md-4">
<div class="cont">
<h1> title 1 </h1>
<h1> title 2 </h1>
</div>
</div>