JavaScript
1
Вклад в тег
function toggleFullScreen(elem) {
if ((document.fullScreenElement !== undefined && document.fullScreenElement === null) || (document.msFullscreenElement !== undefined && document.msFullscreenElement === null) || (document.mozFullScreen !== undefined && !document.mozFullScreen) || (document.webkitIsFullScreen !== undefined && !document.webkitIsFullScreen)) {
if (elem.requestFullScreen) {
elem.requestFullScreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullScreen) {
elem.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
}
user-select: none;
pointer-events: none;
<div class="toolTip">
<p class="toolTip__content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur distinctio dolore ipsam iste nobis pariatur possimus quia, quidem quisquam quos?</p>
<!-- /.toolTip__content -->
</div>
<!-- /.toolTip -->
.toolTip {
width: 400px;
height: 150px;
background-color: #ebebeb;
border-radius: 5px;
margin-left: 50px;
position: relative;
padding: 20px;
&::before {
content: "";
width: 30px;
height: 30px;
transform: rotate(45deg);
position: absolute;
left: -15px;
top: 30%;
background-color: #ebebeb;
}
}
$(document).on('change', '#new_price', function () {
if ($(this).is(':checked')) {
var newPrice = $('.add_item[data-id=1]').attr('data-price') * 1 + $(this).val() * 1;
$('.add_item[data-id=1]').attr('data-price', newPrice);
} else {
var newPrice = $('.add_item[data-id=1]').attr('data-price') * 1 - $(this).val() * 1;
$('.add_item[data-id=1]').attr('data-price', newPrice);
}
})