Serg_pnz,
Вроде да. Только вот я не пойму как его встроить, чтобы он заработал. Я загрузил "MooTools Core 1.4.5 without compatibility" и подключил.
А также взял JS:
window.addEvent('domready', function(){
var scroll1 = new Scroller('drag', {area: 150, velocity: 1});
var scroll2 = new Scroller('mousemove', {area: 100, velocity: 1});
// Drag
$('drag').addEvent('mousedown', function() {
this.setStyle('cursor', 'url(/demos/Scroller/closedhand.cur), move');
scroll1.start();
});
$('drag').addEvent('mouseup', function() {
this.setStyle('cursor', 'url(/demos/Scroller/openhand.cur), move');
scroll1.stop();
});
// Mousemove
$('mousemove').addEvent('mouseover', scroll2.start.bind(scroll2));
$('mousemove').addEvent('mouseout', scroll2.stop.bind(scroll2));
});
HTML:
<div id="mousemove">
<img alt="" src="images/content/img_1.jpg" class="inside move">
</div>
CSS:
#mousemove, #drag {
width: 100%;
height: 100%;
border: 0;
overflow: hidden;
margin: 0 auto;
}
#drag {
cursor: url(openhand.cur), move;
}
.inside {
width: 2000px;
height: 1000px;
}
.move {
/*background: #eee url(pattern1.gif);*/
}
.drag {
}
Вылезает ошибка
Цитата:
|
Uncaught TypeError: Cannot call method 'addEvent' of null index.html:28
(anonymous function) index.html:28
returns mootools-core-1.4.5-full-compat.js:1424
(anonymous function) mootools-core-1.4.5-full-compat.js:1429
(anonymous function) mootools-core-1.4.5-full-compat.js:2899
Element.Methods.Events.fireEvent mootools-core-1.4.5-full-compat.js:2898
(anonymous function) mootools-core-1.4.5-full-compat.js:3605
(anonymous function) mootools-core-1.4.5-full-compat.js:3609
returns mootools-core-1.4.5-full-compat.js:1424
|
Вот строка 28:
$('drag').addEvent('mousedown', function() {