mySwiper.slideTo(index, speed, runCallbacks);
$(document).ready(function(){
$('a').each(function(){
var href = $(this);
var linktxt = href.html();
if(linktxt.length>=100) {
href.html(linktxt.substr(0,100));
href.append(
$('<button>Далее</button>').on('click',function(){
href.html(linktxt);
return false;
});
);
}
});
});
function isScrolledIntoView(el) {
var elemTop = el.getBoundingClientRect().top,
elemBottom = el.getBoundingClientRect().bottom,
isVisible = (elemTop >= 0) && ((elemBottom + 240) <= window.innerHeight);
return isVisible;
}
var visible = false;
$(window).on('scroll', function () {
var $box = $('.boxed-container');
if ($box.size()) {
var vis = isScrolledIntoView($box[0]),
duration = 1000;
if (vis && !visible) {
$box.find('.item2').velocity({left: 0}, {
duration: duration,
complete: function () {
$box.find('.item1').velocity({left: 0}, duration);
}
});
$box.find('.item4').velocity({left: 0}, {
duration: duration,
complete: function () {
$box.find('.item5').velocity({left: 0}, duration);
}
});
}
visible = vis;
}
});
var human = (function (person) {
this.person = {
firstName : "John",
lastName : "Doe",
age : person.age || 50,
eyeColor : person.eyeColor || "blue",
};
this.getInfo = function () {return person.age + ", " + person.eyeColor; }
return this;
});
var getPerson = new human({ eyeColor: "Yellow" });
//
console.log(getPerson.person, getPerson.getInfo());
var canvas = document.getElementById('canvas'),
context = canvas.getContext("2d");
context.fillRect(50, 50, 90, 50)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<canvas id="canvas"></canvas>
<script>
var canvas = document.getElementById('canvas'),
context = canvas.getContext("2d");
context.fillRect(50, 50, 90, 50)
</script>
</body>
</html>