I have this code. I create this rows dinamicly and one row is visible other similar row is hidden. What I need to do is when click on button on visible row to hide that row and show other similar row - next row.
HTML code:
<div class="row preko i63" index="63" style="/* height:100px; *//* padding:30px; *//* position:static; */border-bottom: 1px dashed #ccc;">
<div class="col-md-2 col-xs-2" style=" background: #f4f4f4; ">
<h3 class="text-center">3.</h3>
<p class="text-center">Jul</p>
</div>
<div class="col-md-8 col-xs-8 text-center">
<h3 class="text-orange">€ 22.4</h3>
<p>CURENT BID</p>
</div>
<div class="col-md-2 col-xs-2" style=" margin-top: 25px; "> <a href="#" klik="63" class="btn btn btn-info btn-lg bidbutton pull-right" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Auction ends in: 79d 10h 32m">BID NOW</a> </div>
</div>
<div class="row addOffer j63" style="display:none; border-bottom: 1px dashed #ccc;" index="63">
<div class="col-md-2 col-xs-2" style=" background: #f4f4f4; ">
<h3 class="text-center">3.</h3>
<p class="text-center">Jul</p>
</div>
<div class="col-md-10" style="margin-top:10px;">
<form method="POST" action="http://roomtobid.com/offers" id="target" accept-charset="UTF-8">
<input type="hidden" name="_token" value="v8AnAWXtQJ9OPdapVQpi86zsnCJRoVSGC33vb8MQ"><input name="article_id" type="hidden" value="18"><input name="start" class="hstart" type="hidden" value="07/03/2016 12:00 am"><input name="provera" class="provera" type="hidden" value="79">
<div class="input-group input-symbol large bootstrap-touchspin" style="padding:10px;">
<span style="z-index: 99;">£</span><span class="input-group-btn"><button class="btn btn-default bootstrap-touchspin-down" type="button">-</button></span><span class="input-group-addon bootstrap-touchspin-prefix" style="display: none;"></span><input id="price" type="text" class="form-control price input-lg" name="price" value="22.4" style="display: block;"><span class="input-group-addon bootstrap-touchspin-postfix" style="display: none;"></span>
<div class="input-group-btn"><button class="btn btn-default bootstrap-touchspin-up" type="button">+</button><button type="submit" class="btn btn-info runload input-lg okvir">PLACE BID</button></div>
</div>
</form>
</div>
</div>
Currently I rite this JS code and work but very very slowly (especcialy on mobile phone browesers) probbaly becouse I have so many classes created. JS CODE:
function bidbook() {
$('.bidbutton').on( "click", function(evt) {
$('.addOffer').hide();
$('.preko').show();
var i = $(this).attr('klik');
$('.i'+i).hide();
$('.j'+i).show();
evt.preventDefault();
});
};
Is there any better way to solve this problem (hide/show rows) becouse this way is so slow...
