/^\S*$/;
/^[\s\S]{1,10}/
transition: background-color 400ms ease;
var new_script = $('<script />', {
src: 'https://...',
async: true,
});
$('body').append(new_script);
//...some actions
new_script.remove();
$(document).scroll(function () {
if ($(this).scrollTop() <= ($(".block").offset().top - $(window).height())) {
//sticky
} else {
//not sticky
}
}
* {
box-sizing: border-box;
}
.block {
background-color: red;
height: 200px;
width: 300px;
position: relative;
}
.block:before {
content: '';
position: absolute;
left: 0px;
top: 0px;
border-top: 30px solid white;
border-right: 30px solid red;
z-index: 1;
}
.block:after {
content: '';
display: none;
position: absolute;
left: -7px;
top: 14px;
width: 42px;
border-top: 1px solid black;
transform: rotate(-45deg);
z-index: 1;
}
.block:hover {
border: 1px solid black;
}
.block:hover:before {
left: -1px;
top: -1px;
}
.block:hover:after {
display: block;
}
// jQuery plugin to prevent double submission of forms
jQuery.fn.preventDoubleSubmission = function() {
$(this).on('submit',function(e){
var $form = $(this);
if ($form.data('submitted') === true) {
// Previously submitted - don't submit again
e.preventDefault();
} else {
// Mark it so that the next submit can be ignored
$form.data('submitted', true);
}
});
// Keep chainability
return this;
};