当前位置: 编程技术>WEB前端
本页文章导读:
▪Swipebox – 用于触屏设备的精美 jQuery Lightbox 插件 Swipebox 是一款可触摸的 jQuery 灯箱效果插件,可用于桌面,移动和平板电脑。它移动设备支持滑动手势导航,桌面电脑上可以用键盘导航,不支持 CSS3 过渡特性的浏览器使用 jQuery 降级.........
▪html5摇骰子游戏 学习html5,做的摇骰子游戏。。。。<html> <head> <meta charset="utf-8"> <title>骰子游戏</title> <style> body{ text-align:center;} #can{ border:1px solid b.........
▪lightbox——解析 start: function(imageLink) {
hideSelectBoxes();
var arrayPageSize = getPageSize();
Element.setHeight('overlay', arrayPageSize[1]);//阴影部分
new Effect.Appear('overlay', { duration: 0.1, from: 0.0, to: 0.8 });//遮盖程度
imageArray .........
[1]Swipebox – 用于触屏设备的精美 jQuery Lightbox 插件
Swipebox 是一款可触摸的 jQuery 灯箱效果插件,可用于桌面,移动和平板电脑。它移动设备支持滑动手势导航,桌面电脑上可以用键盘导航,不支持 CSS3 过渡特性的浏览器使用 jQuery 降级处理,支持视网膜显示,能够通过 CSS 轻松定制。
在下列浏览器测试通过:Chrome, Safari, Firefox, Opera, IE8+, IOS4+, Android, Windows Phone。
您可能感兴趣的相关文章
- 期待已久的2012年度最佳 jQuery 插件揭晓
- 精心挑选的优秀jQuery Ajax分页插件和教程
- 推荐几款非常棒的 jQuery 全景图片展示插件
- 12款经典的白富美型 jQuery 图片轮播插件
- 精心挑选优秀的 JavaScript 日历和时间插件
效果演示 插件下载
您可能感兴趣的相关文章
- 分享35个非常漂亮的单页网站设计案例
- 10套精美的免费网站后台管理系统模板
- 25个国外优秀的餐饮网站设计案例欣赏
- 25个国外优秀的电子商务网站设计案例
- 12个优秀的 HTML5 网站设计案例欣赏
本文链接:Swipebox – 用于触屏设备的 jQuery 灯箱效果插件
编译来源:梦想天空 ◆ 关注前端开发技术 ◆ 分享网页设计资源
本文链接
[2]html5摇骰子游戏
学习html5,做的摇骰子游戏。。。。
<html>
<head>
<meta charset="utf-8">
<title>骰子游戏</title>
<style>
body{ text-align:center;}
#can{ border:1px solid black;}
</style>
</head>
<body>
<canvas id='can' width='500px' height='400px'></canvas>
<br>
<br>
<input type='button' id='btnStart' value='开始'>
</body>
</html>
<script>
//定时器变量
var tidck =null;
//存放图片的容器
var can;
//画布
var ctx;
//骰子每次的点数的数组
var SumArray = [];
//摇骰子点数的总次数
//var sum = 0;
//每次骰子点数的和
var ranSum = 0;
//骰子变化次数
var count = 0;
//圆点的坐标
var pointCoordinates = [[20,20],[[10,10],[30,30]],[[10,10],[20,20],[30,30]],[[10,10],[10,30],[30,10],[30,30]],[[10
<head>
<meta charset="utf-8">
<title>骰子游戏</title>
<style>
body{ text-align:center;}
#can{ border:1px solid black;}
</style>
</head>
<body>
<canvas id='can' width='500px' height='400px'></canvas>
<br>
<br>
<input type='button' id='btnStart' value='开始'>
</body>
</html>
<script>
//定时器变量
var tidck =null;
//存放图片的容器
var can;
//画布
var ctx;
//骰子每次的点数的数组
var SumArray = [];
//摇骰子点数的总次数
//var sum = 0;
//每次骰子点数的和
var ranSum = 0;
//骰子变化次数
var count = 0;
//圆点的坐标
var pointCoordinates = [[20,20],[[10,10],[30,30]],[[10,10],[20,20],[30,30]],[[10,10],[10,30],[30,10],[30,30]],[[10
[3]lightbox——解析
来源: 互联网 发布时间: 2013-11-19
start: function(imageLink) {
hideSelectBoxes();
var arrayPageSize = getPageSize();
Element.setHeight('overlay', arrayPageSize[1]);//阴影部分
new Effect.Appear('overlay', { duration: 0.1, from: 0.0, to: 0.8 });//遮盖程度
imageArray = [];
imageNum = 0;
if (!document.getElementsByTagName){ return; }
var anchors = document.getElementsByTagName('a');
// if image is NOT part of a set..
if((imageLink.getAttribute('rel') == 'lightbox')){
// add single image to imageArray
imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title')));
} else {
// if image is part of a set..
// loop through anchors, find other images in set, and add them to imageArray
for (var i=0; i<anchors.length; i++){
var anchor = anchors[i];
if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))){
imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));
}
}
imageArray.removeDuplicates();
while(imageArray[imageNum][0] != imageLink.getAttribute('href')) { imageNum++;}
}
Element.setTop('lightbox', 0);
Element.show('lightbox');
this.changeImage(imageNum);
},
changeImage: function(imageNum) {
activeImage = imageNum; // update global var
// hide elements during transition
Element.show('loading');
Element.hide('lightboxImage');
Element.hide('hoverNav');
Element.hide('prevLink');
Element.hide('nextLink');
Element.hide('imageDataContainer');
Element.hide('numberDisplay');
imgPreloader = new Image();
// once image is preloaded, resize image container
imgPreloader.onload=function(){
Element.setSrc('lightboxImage', imageArray[activeImage][0]);//图片地址
myLightbox.resizeImageContainer(300, 300);//图片容器大小
};
imgPreloader.src = imageArray[activeImage][0];//图片地址
},
resizeImageContainer: function( imgWidth, imgHeight) {
// get current height and width
this.wCur = Element.getWidth('outerImageContainer');
this.hCur = Element.getHeight('outerImageContainer');
this.xScale = ((imgWidth + (borderSize * 2)) / this.wCur) * 100;
this.yScale = ((imgHeight + (borderSize * 2)) / this.hCur) * 100;
// calculate size difference between new and old image, and resize if necessary
wDiff = (this.wCur - borderSize * 2) - imgWidth;
hDiff = (this.hCur - borderSize * 2) - imgHeight;
if(!( hDiff == 0)){ new Effect.Scale('outerImageContainer', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); }
if(!( wDiff == 0)){ new Effect.Scale('outerImageContainer', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); }
if((hDiff == 0) && (wDiff == 0)){
if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);}
}
Element.setHeight('prevLink', 300);
Element.setHeight('nextLink', 300);
Element.setWidth( 'imageDataContainer',320);//设置关闭按钮的长度
this.showImage();//图片的大小关键还在这里
},
showImage: function(){
Element.hide('loading');
Element.setHeight('lightboxImage', 300);//设置图片大小,哈哈哈
Element.setWidth('lightboxImage', 300);//设置图片宽度大小,哈哈哈
new Effect.Appear('lightboxImage', { duration: 0.5, queue: 'end', afterFinish: function(){ myLightbox.updateDetails(); } });
this.preloadNeighborImages();
},
updateDetails: function() {
Element.show('caption');
Element.setInnerHTML( 'caption', imageArray[activeImage][1]);
// if image is part of set display 'Image x of x'
if(imageArray.length > 1){
Element.show('numberDisplay');
Element.setInnerHTML( 'numberDisplay', "第 " + eval(activeImage + 1) + " 张,总 " + imageArray.length);
}
new Effect.Parallel(
[ new Effect.SlideDown( 'imageDataContainer', { sync: true, duration: resizeDuration + 0.25, from: 0.0, to: 1.0 }),
new Effect.Appear('imageDataContainer', { sync: true, duration: 1.0 }) ],
{ duration: 0.65, afterFinish: function() { myLightbox.updateNav();} }
);
},
作者:happy513842343 发表于2013-3-26 17:12:58 原文链接
阅读:0 评论:0 查看评论
最新技术文章:
 
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!