var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutationRecord) {
console.log('Стили изменились!');
});
});
var target = document.getElementById('elementid');
observer.observe(target, { attributes : true, attributeFilter : ['style'] });
$("#myDiv").attrchange({
trackValues: true, // set to true so that the event object is updated with old & new values
callback: function(evnt) {
if(evnt.attributeName == "display") { // which attribute you want to watch for changes
if(evnt.newValue.search(/inline/i) == -1) {
// your code to execute goes here...
}
}
}
});
<input id="" type="checkbox" onclick="handleChange(this)">
.labelChecked{
background: #9abb82;
}
.labelIChecked{
left: auto;
right: 0;
}
.beforeChecked{
content: "on";
right: 120%;
color: #82a06a;
text-shadow: 0 1px 0 #afcb9b, 0 -1px 0 #6b8659;
}
function handleChange(chk) {
var label = document.getElementsByTagName("label")[0];
var labelI = document.querySelectorAll('label i')[0];
var labelBefore = document.querySelectorAll('label i:before')[0];
if(chk.checked == true){
label.classList.add(".labelChecked");
labelIChecked.classList.add(".labelIChecked");
beforeChecked.classList.add(".beforeChecked");
}else{
label.classList.remove(".labelChecked");
labelIChecked.classList.remove(".labelIChecked");
beforeChecked.classList.remove(".beforeChecked");
}
}
.scrolloff {
pointer-events: none;
}
$(document).ready(function () {
$('#map1').addClass('scrolloff');
$('#overlay').on('click', function () {
$('#map1').removeClass('scrolloff');
});
$("#map1").mouseleave(function () {
$('#map1').addClass('scrolloff'); /
});
});
<section id="overlay" class="map">
<iframe id="map1" src="" width="1170" height="400" frameborder="0" style="border: 0"></iframe>
</section>