GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javaScript/roundabout/js/script.js at master · yittiger/javaScript

Expand file tree

/

script.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
61 lines (61 loc) · 2.17 KB
/

script.js

Copy path

File metadata and controls

61 lines (61 loc) · 2.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
$(document).ready(function(){
// 控制旋转
$('#img-slider li').bind({
reposition: function() {
var degrees = $(this).data('roundabout').degrees,
roundaboutBearing = $(this).parent().data('roundabout').bearing,
rotateY = Math.sin((roundaboutBearing - degrees) * (Math.PI/180)) * 9;
$(this).css({
"-webkit-transform": 'rotate(' + rotateY + 'deg)',
"-moz-transform": 'rotate(' + rotateY + 'deg)',
"-ms-transform": 'rotate(' + rotateY + 'deg)',
"-o-transform": 'rotate(' + rotateY + 'deg)',
"transform": 'rotate(' + rotateY + 'deg)'
});
}
});
$('.jQ_sliderPrev').on('click', function(){
$('#img-slider').roundabout('animateToNextChild');
return false;
});
$('.jQ_sliderNext').on('click', function(){
$('#img-slider').roundabout('animateToPreviousChild');
return false;
});
// 添加键盘左右事件
$('body').on('keyup', function(e) {
var keyCode = e.which || e.keyCode;
if(keyCode == 37) {
$('#img-slider').roundabout('animateToPreviousChild');
e.preventDefault();
return false;
} else if(keyCode == 39) {
$('#img-slider').roundabout('animateToNextChild');
e.preventDefault();
return false;
}
});
// 点击小圆点
$('.jQ_sliderSwitch li').on('click', function() {
var $elem = $(this);
var index = $elem.index();
$('#img-slider').roundabout('animateToChild', index);
return false;
});
// 动画效果
$('#img-slider').roundabout({
minScale: 0.4, //Scale控制图片大小
maxScale: 0.9,
duration: 450,
responsive: true,
//autoplay: true,
//autoplayPauseOnHover: true,
btnStopAutoplay: true
}).bind({
animationEnd: function(e) { //动画完回调
var index = $('#img-slider').roundabout('getChildInFocus');
$('.jQ_sliderSwitch li').removeClass('active');
$('.jQ_sliderSwitch li').eq(index).addClass('active');
}
});
});
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.