var auto = $.jqwidont.auto(); // is automatic initialisation enabled?
$.jqwidont.auto(false); // disable it
$.jqwidont.init(); // perform the default behaviour
$('p').widont();
var string = $.jqwidont.transform('No widows here!'); // string = 'No widows here!'
function preloader() {
// counter
var i = 0;
// create object
imageObj = new Image();
// set image list
images = new Array();
images[0]="image1.jpg"
images[1]="image2.jpg"
images[2]="image3.jpg"
images[3]="image4.jpg"
// start preloading
for(i=0; i<=3; i++) {
imageObj.src=images[i];
}
}
function firstFunction(_callback){
// do some asynchronous work
// and when the asynchronous stuff is complete
_callback();
}
function secondFunction(){
// call first function and pass in a callback function which
// first function runs when it has completed
firstFunction(function() {
console.log('huzzah, I\'m done!');
});
}
transform: rotate(9999999deg)
scp username@192.168.1.111:/path/to/myfile.txt /Users/Jamie/local/path/to/myfile.txt
@keyframes anim {
0% {
transform: translate(-30px, 90px);
}
10% {
transform: translate(-24px, 57.6px);
}
20% {
transform: translate(-18px, 32.4px);
}
30% {
transform: translate(-12px, 14.4px);
}
40% {
transform: translate(-6px, 3.6px);
}
50% {
transform: translate(0px, 0px);
}
60% {
transform: translate(6px, 3.6px);
}
70% {
transform: translate(12px, 14.4px);
}
80% {
transform: translate(18px, 32.4px);
}
90% {
transform: translate(24px, 57.6px);
}
100% {
transform: translate(30px, 90px);
}
}
<a href="#id-price" style="position: fixed; top: 0; left:0; z-index: 2000">some text</a>
function hasClass(ele,cls) {
return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}
function removeClass(ele,cls) {
if (hasClass(ele,cls)) {
var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
ele.className=ele.className.replace(reg,' ');
}
}
removeClass(div, 'class_key-word')
window.onscroll
window.pageYOffset
el.style.translate = transform3d(x, y + window.pageYOffset, z)
<div class="path__cursor" style="transform: translate3d(756.21px, 2968px, 0.001px);"></div>
<style>
body{
width: 100%;
height: 300vh;
}
section{
position: fixed;
left: 0;
top: 0;
height: 200px;
width: 100%;
background-color: royalblue;
transition: height 2s;
}
</style>
<section></section>
<script>
let section = document.querySelector('section');
window.onscroll = magic;
function magic(){
// 500 расстояние при котором событие произойдет
if (window.pageYOffset > 500) {
section.style.height = '500px'
} else {
section.style.height = '200px'
}
}
</script>