$(".videos").append('<ul><li><div class="videos_image"><a href="pagevideo/"><img src="/media/images/' + data.image + '" width="250" height="180" /></a></div><div class="videos_title">' + data.title + '</div><div class="videos_views"> <p> Просмотров:' + data.views + ' </p> </div></li></ul>');
if( $(window).scrollTop() + $(window).height >= $(document).height() && !inProcess ) {
$(window).height()
вместо $(window).height
<?
session_start();
if($_POST['is18years'] == 'yes' || $_POST['is18years'] == 'no') $_SESSION['is18years'] = $_POST['is18years'];
if(isset($_SESSION['is18years'])) {
if($_SESSION['is18years'] == 'no') {
header("Location: /access_denied.html");
exit;
}
}
?>
<?
if(!isset($_SESSION['is18years'])):
?>
<div class="body_overhead">
<div class="overhead_window">
<div class="oh_wnd_header">
<p>Доступ к сайту могут осуществлять только лица, достигшие возраста 18 лет</p>
<p style="font-weight: bold;">Вам уже есть 18 лет?</p>
<p>
<span style="color: green" class="is18years yes18">ДА, мне уже есть 18 лет</span> | <span style="color: red" class="is18years no18">НЕТ, мне еще нет 18 лет</span>
</p>
</div>
</div>
</div>
<style>
.body_overhead {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.95);
z-index: 999999999;
}
.overhead_window {
top: 10%;
left: 30%;
width: 40%;
background: #fff;
position: relative;
}
.oh_wnd_header {
padding: 20px;
color: #333;
text-align: center;
}
.is18years {
cursor: pointer;
}
</style>
<?
endif;
?>
<script>
// проверка на 18 лет
$('.is18years').click(function(){
if($(this).hasClass('yes18') || $(this).hasClass('no18')) {
var is18years = $(this).hasClass('yes18') ? 'yes' : 'no'
$.ajax({
type: "POST",
context: document.head,
data: { is18years: is18years },
success: function(){
if(is18years === 'yes') {
$('.body_overhead').hide()
} else {
document.location.href = '/access_denied.html'
}
}
})
}
})
</script>
<div class="changeable">
<div id="block-1" class="block visible">Первый</div>
<div id="block-2" class="block">Второй</div>
</div>
div.block {
display: none;
}
div.block.visible {
display: block;
}
$('.block').on('click', function(){
$(this).closest('.changeable').find('.block').toggleClass('visible');
});
var i = 100;
while (i >= 0) {
if (i%50==0 || i%20==0 || i==10) {
document.write('Number: ' + i + '<br />');
}
i -= 10
}
function sticker1220() {
console.log('sticker1220');
};
function sticker950() {
console.log('sticker950');
};
function sticker320() {
console.log('sticker320');
};
function checksize() {
if ( $(window).width() > 1220 ) {
sticker1220();
} else if ( $(window).width() > 640 & $(window).width() < 1219 ) {
sticker950();
} else if ( $(window).width() < 639 ) {
sticker320();
}
};
checksize();
$(window).resize(function() {
checksize();
$('p').text($(window).width());
});
if(e.which == 39) {
if($('[data-popup-image-id="'+activeItemId+'"]').next().length !== 0) {
$('[data-popup-image-id="'+activeItemId+'"]').next().addClass('active');
$('[data-popup-image-id="'+activeItemId+'"]').removeClass('active');
$('.popup_gallery__images-item').data('popupImageId', activeItemId + 1);
}
}
if(e.which == 37) {
if($('[data-popup-image-id="'+activeItemId+'"]').prev().length !== 0) {
$('[data-popup-image-id="'+activeItemId+'"]').prev().addClass('active');
$('[data-popup-image-id="'+activeItemId+'"]').removeClass('active');
$('.popup_gallery__images-item').data('popupImageId', activeItemId - 1);
}
}
$('select').change(function() {
if ( navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 ) {
var selIndex = $(this).find('option:selected').index()+1;
$(this)
.find('option')
.removeAttr('selected')
.end()
.find('option:nth-child('+selIndex+')')
.attr('selected', 'selected')
.end()
.find('option:not(:nth-child('+selIndex+'))')
.prop('selected', false)
.end()
.find('option:nth-child('+selIndex+')')
.prop('selected', true)
} else {
var selIndex = $(this).find('option:selected').index()+1;
$(this).find('option').removeAttr('selected').end().find('option:nth-child('+selIndex+')').attr('selected', 'selected');
$(this).val($(this).find('option[selected="selected"]').val());
}
// $(this).val()
$.ajax({
url: '',
data: {
a: $(this).val()
},
// ...
})
})