clearString = str => {
const trash = str.match(/(.)\1{1,}/g)
for(let o in trash) {
str = str.replace(trash[o], trash[o].substr(0,1)+'*')
}
return str;
}
console.log(clearString('aabc11d'))
$('.product-listing .four-cont').hover(function() {
var $img = $(this).find('.image img'),
cacheImg = $img.attr('src');
if($img.data('additionalImage')) {
$img.fadeOut(500, function() {
$img.attr('src', $img.data('additionalImage'));
$img.data('additionalImage', cacheImg);
$img.fadeIn(500);
});
}
});
data: {
...
visibility: 'cpu' //активная вкладка по дефолту
},
methods: {
golist: function(val) {
this.visibility = val;
...
}
}
<li><a href="#" v-on:click="golist('cpu')" :class="{ active: visibility == 'cpu' }">Процессоры</i></a></li>
<li><a href="#" v-on:click="golist('gpu')" :class="{ active: visibility == 'gpu' }">Видеокарты</i></a></li>
<li><a href="#" v-on:click="golist('games')" :class="{ active: visibility == 'games' }">Игры</a></li>
<?php $the_query = new WP_Query('page_id=128'); ?>
<?php while ($the_query->have_posts() ) : $the_query->the_post(); ?>
<?php if(get_field('sizes')): ?>
<?$cnt = 0;?>
<?php while(has_sub_field('sizes')): ?>
<label for="r<?=(++$cnt);?>">
<?php endwhile; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php wp_reset_postdata();?>