2
I’m using a script to switch a block with Nav Tabs, the first part of the code works normally, but the part where I request the border-color and play to the other field is only working in Chrome, would someone tell me why?
JS:
$(function(){
$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
var corbackground = $('#myTab>.active>a').css('border-color');
$('.tab-content').css('border-color',corbackground);
});
});
HTML:
<ul class="nav nav-tabs" id="myTab">
<li class="active"><a href="#peito">Peito</a></li>
<li><a href="#biceps">Biceps</a></li>
<li><a href="#costa">Costa</a></li>
<li><a href="#triceps">Triceps</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="peito">
<a href="#idphp" class="exercicio" title=""></a>
</div>
<div class="tab-pane" id="biceps">2</div>
<div class="tab-pane" id="costa">3</div>
<div class="tab-pane" id="triceps">4</div>
</div>
Without seeing the HTML gets a little difficult, but by the logic should not take the border-color of $(this) that was clicked?
– Jader A. Wagner
Exactly, it’s the same element of this, but it still didn’t work, so I tried to create the selector again to see if it solved and also nothing.
– Marcelo Formentão