var number = $('.portfolio li.active').attr('data-slide-to');
console.log(number)
Ну как это нету, если есть:
<div class="row portfolio">
<div class="carousel slide container" id="myCarousel2">
<ol class="carousel-indicators">
<li class="active" data-slide-to="0" data-target="#myCarousel2"></li>
<li data-slide-to="1" data-target="#myCarousel2"></li>
<li data-slide-to="2" data-target="#myCarousel2"></li>
<li class="important"><span class="numbernew">1</span> из <span class="all"></span></li>
</ol>
</div>
</div>
console.log($('.portfolio li.active').data('slide-to'))
если нету тоconsole.log($('.portfolio li.active').attr())
console.log($('.portfolio li').attr())
console.log($('.portfolio').html())