i picked this code online but i'm unable to understand how it works. without understanding i cannot edit it for my use. it is for closing a panel by up-slide when i click on "x" button. i want to know how is the effect created in the script? here is the html:
<div class="col-md-3 col-sm-6 col-xs-6">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Using Slide Up</h3>
<span class="pull-right clickable" data-effect="slideUp">x</span>
</div>
<div class="panel-body">Panel content</div>
<div class="panel-footer">Panel footer</div>
</div>
</div>
the script working on this is:
$(function() {
$('.clickable').on('click', function() {
var effect = $(this).data('effect');
$(this).closest('.panel')[effect]();
});
});