window.addEventListener("unload", logData, false);
function logData() {
navigator.sendBeacon("/log", analyticsData);
}
var num = 1;
$('.b1').on('click', function (e) {
num = parseInt($(this).data('num'));
})
$('.modal').on('shown.bs.modal', function () {
$('.slider__prod').slick({
initialSlide: num-1,
arrows: true,
prevArrow: '<button class="slick-prev slick-arrow" aria-label="Prev" type="button" style=""><i class="fa fa-chevron-left" aria-hidden="true"></i></button>',
nextArrow: '<button class="slick-next slick-arrow" aria-label="Next" type="button" style=""><i class="fa fa-chevron-right" aria-hidden="true"></i></button>'
});
});
var revs;
revs = $('.tp-banner1').revolution({
delay: 6000,
startheight: 910,
startwidth: 1170,
hideThumbs: true,
thumbWidth: 100,
thumbHeight: 50,
thumbAmount: 5,
navigationType: "bullet",
navigationArrows: "none",
navigationStyle: "round",
touchenabled: "on",
onHoverStop: "on",
navOffsetHorizontal: 0,
navOffsetVertical: 20,
shadow: 0,
fullWidth: "on",
fullScreen: "on"
});
.mc_item_wrap.active:after {
content: "";
width: 18px;
height: 9px;
background-image: url(../img/mc_c_ar.png);
position: absolute;
margin: 11px -11px;
}
$('form').on('submit', function(e){
var em = $("#email").val();
var ph = $("#phone").val();
if ((em == '') && (ph == '')){
alert('error');
e.preventDefault();
} else {
alert('done')
}
});
<select class="ajax-select" data-table="table1" data-result="#select2" id="select1">
<option value="op0">op0</option>
<option value="op1">op1</option>
<option value="op2">op2</option>
</select>
<select class="ajax-select" data-table="table2" data-result="#select3" id="select2">
<option value="">выберите вариант из select1 </option>
</select>
$('.ajax-select').on('change', function(){
var val = $(this).val();
var table = $(this).data('table');
var result = $(this).data('result');
$.ajax({
type: 'POST',
url: 'http://site.ru/',
data: ({table : table, val : val}),
success: function(data){
$(result).html(data);
$(result).removeAttr('disabled');
},
error: function(){
alert('error');
}
});
});
<ul>
<li><a class="ajax-form" data-form="form1.html" data-content="#content">Форма 1</a></li><!--кнопка 1 таба-->
<li><a class="ajax-form" data-form="form2.html" data-content="#content2">Форма 2</a></li><!--кнопка 2 таба-->
<li><a class="ajax-form" data-form="form3.html" data-content="#content3">Форма 3</a></li><!--кнопка 3 таба-->
<li><a class="ajax-form" data-form="form4.html" data-content="#content4">Форма 2</a></li><!--кнопка 4 таба-->
</ul>
<div id="content"><!--контент таба 1-->
</div>
<div id="content2"><!--контент таба 2-->
</div>
<div id="content3"><!--контент таба 3-->
</div>
<div id="content4"><!--контент таба 4-->
</div>
$('.ajax-form').on('click',function(e){
e.preventDefault();
var form = $(this).data('form');
var content = $(this).data('content');
$.ajax({
type: "POST",
url: form,
cache: false,
success: function(data) {
$(content).html(data);
},
error: function(data) {
$(content).html('data-err');
}
});
});
<?php
if(isset($_POST['submit'])){
if($_POST['login'] == "Admin"){
echo "Неправильно";
return;
}
else {
echo $_POST['login'];
return;
}
}
?>
$("#markerlist").on("click","div", function(){
$('#markerlist div').hide();
$(this).show();
return false;
});
var background = chrome.extension.getBackgroundPage();
addEventListener("unload", function (event) {
background.console.log(event.type);
}, true);
echo "<script>alert('Сообщение отправлено!');</script>";
.grayscale+p {
pointer-events:none;
}