<div class="slider">
<div class="slide"></div>
<div class="slide"></div>
<div class="slide"></div>
<div class="slide"></div>
</div>
$('.gallery_item').click(function(){
var bgSrc = $('.gallery__item > .js-background > .js-image').attr('src');
$('.gallery__item > .js-background').css('background-image', 'url("' + bgSrc + '")');
});
$('.gallery_item').click(function(){
var bgSrc = $(this).find('.js-image').attr('src');
$(this).find('.js-background').css('background-image', 'url("' + bgSrc + '")');
});
$('body').on('click', '.block-lesson', function (e) {
$(modal).modal('show').find('.modal-content').load($(this).data('href'));
//здесь инициализируйте нужные дэйтпикеры и селекты2 для вашей модалки или чего-то там
$('.datetimepicker').datetimepicker({
format: 'DD MMMM YYYY',
pickTime: false,
locale: 'ru',
language: 'ru-RU',
});
$('.select2').select2();
})
<input type="submit" class="superbutton" value="Яндекс Деньги" data-transfer="20" />
$('input[type=submit]').click(function() {
$(this).val($(this).attr('data-transfer'));
}
$(document).on('click', '#addDiv', function () {
$('#newDiv').append("<div class='summernote'></div><div class='select2'></div>");
$('.summernote').summernote();
...
}
$(document).on('click', '#addDiv', function () {
$('#newDiv').append("<div class='summernote' id="summer1"></div><div class='select2' id="select2"></div>");
$('#summer1').summernote({
height: null,
lang: 'ru-RU',
toolbar: [
["style", ["style"]],
["font", ["bold", "italic", "underline", "clear"]],
["fontname", ["fontname"]],
["color", ["color"]],
["para", ["ul", "ol", "paragraph"]],
["height", ["height"]],
["table", ["table"]],
["insert", ["link", "picture", "video", "hr"]],
["view", ["fullscreen", "codeview"]],
["help", ["help"]]
],
popover: {
image: [
['custom', ['imageAttributes']],
['float', ['floatLeft', 'alignCenter', 'floatRight']],
['remove', ['removeMedia']]
],
link: [
['link', ['linkDialogShow', 'unlink']]
],
air: [
['color', ['color']],
['font', ['bold', 'underline', 'clear']],
['para', ['ul', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture']]
]
},
callbacks: {
onInit: null,
onFocus: null,
onBlur: null,
onEnter: null,
onKeyup: null,
onKeydown: null,
onSubmit: null,
onImageUpload: function (files) {
var $editor = $(this);
var data = new FormData();
data.append('file', files[0]);
$.ajax({
url: '{{ route("iup") }}',
method: 'POST',
data: data,
processData: false,
contentType: false,
success: function (response) {
$editor.summernote('insertImage', response);
}
});
},
onImageUploadError: null
}
});
}