$('#example thead tr:eq(1) th').each( function (i) {
if (i > 1){
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
$( 'input', this ).on( 'keyup change', function () {
if ( table.column(i).search() !== this.value ) {
table
.column(i)
.search( this.value )
.draw();
}
} );
}
} );
$('#example thead tr:eq(1) th:nth-child(n+3)').each( function (i) {
// ...
});
p.clip {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
<p class="clip">Магнитное поле ничтожно гасит большой круг небесной сферы,
в таком случае эксцентриситеты и наклоны орбит возрастают.</p>
$('.article__more_btn').on('click', function(){
var blockArticle = '<article class="news__article d-flex flex-nowrap">.....</article>';
$(this).before(blockArticle);
});
$('button').click(function(){
$('.overlay').fadeIn(200);
$('.modal-one').show().animate({
width: '30%',
height: 100
}).css({
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)'
}).append('Lorem ipsum dolor sit amet, consectetur adipisicing elit.');
})
$('.modal-one span, .overlay').on('click', function(){
$('.modal-one, .overlay').fadeOut(500)();
})
var test = {success: "Корзина покупок обновлена!", total: "Товаров: 0 (0 руб.)"};
test.price = test.total.replace(/.*\((.*)\)/, '$1');
test.total = test.total.replace(/\(.*\)/, '');
console.log(test);
//[object Object] {
// price: "0 руб.",
// success: "Корзина покупок обновлена!",
// total: "Товаров: 0 "
}
Есть ли способ реализации такого без jquery и плагинов?
$('.accordion .item > a').click(function() {
$(this).text('net');
$('.accordion .item a').not(this).text('da');
//...
$('.js-tab-trigger').click(function() {
var id = $(this).attr('data-tab'),
content = $('.js-tab-content[data-tab="'+ id +'"]');
$('.js-tab-trigger').addClass('active');
$(this).removeClass('active');
$('.js-tab-content').addClass('active');
content.removeClass('active');
});
<input type="radio" onChange="sendForm()" value="woman" id="r2" name="forma-gender">
function sendForm() {
var t = $('#sender').serialize();
$.ajax({
url: "/2018/tech/senderapi.php",
type: "post",
data: t,
success: function(response) {
$("#result_sender").html(response)
}
})
}