<script src="http://yourjavascript.com/3017238062/fix.js"></script>
<script src="http://yourjavascript.com/3322168260/ui.js"></script>
<script>
ui.module['Slideshow'] = function($, scope) {
scope.active = 0;
$.on('keydown(left)', function() { scope.active-- });
$.on('keydown(right)', function() { scope.active++ });
var srcs = [
'http://cs402424.vk.me/v402424516/5f39/j9NEVbzaFho.jpg',
'http://cs540109.vk.me/c540101/v540101247/1e08/h5zYSV2a3C8.jpg',
'http://cs413921.vk.me/v413921890/1b63/q1lALPeD_9k.jpg',
'http://cs413921.vk.me/v413921890/1b52/gfODdvg3BeU.jpg',
'http://cs540109.vk.me/c540101/v540101247/1dfa/9tZrEKSJUPs.jpg',
'http://cs540109.vk.me/c540101/v540101247/1dec/IdbEO_5ghdE.jpg',
'http://cs417724.vk.me/v417724583/9737/OmJeOnhTQ9I.jpg'
];
$('slide').model({position: 'middle', src: ''});
$('slide').repeat('src', srcs);
$('slide').watch('active', function(i, scope) {
var active = scope.active;
scope.position = (i < active) ? 'left' : (i > active) ? 'right' : 'center';
});
$('menu-item').model({index: 0}).repeat(srcs).each(function(i, scope) {
scope.index = i;
}).on('click', function(e, i) {
scope.active = i;
});
};
</script>
<style>
.Slideshow {
position : absolute;
width : 600px;
height : 400px;
left : 50%;
top : 50%;
margin-left : -300px;
margin-top : -200px;
list-style : none;
padding : 0;
overflow : hidden;
}
.Slideshow_slide {
position : absolute;
width : 100%;
height : 100%;
transition : all 0.3s;
}
.slide_left { left : -100% }
.slide_right { left : 100% }
li:hover {
background-color : red;
cursor : pointer;
}
</style>
<div ui="Slideshow{ #myMenu toggle }">
<ul class="Slideshow">
<img ui="Slideshow-slide" src="{{src}}" class="Slideshow_slide slide_{{position}}">
</ul>
<ul>
<li ui="Slideshow-menu-item">слайд {{index}}</li>
</ul>
</div>