HTML5中国

 找回密码
 立即注册

QQ登录

只需一步,快速开始

HTML5中国 首页 教程视频 HTML5教程 查看内容

HTML5的音频和JQUERY的全屏幻灯片

2012-2-1 15:25| 发布者: admin| 查看: 17168| 评论: 10|原作者: yanny

摘要: 在今天的教程中,我们将创建一个全屏的照片幻灯片来说明纽约图片系列。 我们将增加对HTML5的音频元素的声音,为了给生活画廊,并尝试重建这个充满活力的城市环境。 在今天的教程中,我们将创建一个全屏的照片幻灯片 ...
在今天的教程中,我们将创建一个全屏的照片幻灯片来说明纽约图片系列。 我们将增加对HTML5的音频元素的声音,为了给生活画廊,并尝试重建这个充满活力的城市环境。

在今天的教程中,我们将创建一个全屏的照片幻灯片来说明纽约图片系列。 我们将增加对HTML5的音频元素的声音,为了给生活画廊,并尝试重建这个充满活力的城市环境。

要创建幻灯片和全屏图片显示,我们将使用在拉斯维加斯的jQuery插件,编译以前在文章中的一个插件Codrops共享的很多想法。 嗡嗡声,一个JavaScript音频库将控制音频元素。 你可以找到更多关于这两个插件,我在我的网站上写道: 周杰伦Salvat的网站 。

将五香与一个自定义的使用滚动条的缩略图导航JScrollPane 的开尔文的运气和一些缓解效果所提供的 jQuery 的宽松插件乔治麦克金尼史密斯。

标记

让我们搭建舞台! 首先,我们创建一个占位符包含图片标题和学分。
  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><div id="title"></span> <div id="title"></span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><h1>New York Gallery</h1></span> <H1>纽约画廊</ H1></span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><p>Pictures by <a href="http://www.flickr.com/">Alessandro Artini</a></p></span> <p>照片href="http://www.flickr.com/">亚历山德罗雅天妮</ A> </ P></span>
  4. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></div></span> </ DIV></span>
复制代码

然后被放置在一个无序列表缩略图。 每个缩略图链接到一个大代表性的图片,并进行图片的标题。 请注意,我们添加一个数据属性,某些环节,调整垂直对齐显示全屏图片,以避免种植的重要组成部分。

两个空的div添加举行的指针和闪光效果的幻灯片更改时。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><div id="flash"></div></span> <div id="flash"> </ DIV></span>
  2. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><div id="thumbnails"></span> <div id="thumbnails"></span>
  3.   <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><ul></span> <UL></span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><li></span> <LI></span>
  5.       <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><a href="01.jpg"></span> <a href="01.jpg"></span>
  6.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><img src="01b.jpg" title="New York moving" data-valign="top"></span> <img src="01b.jpg" title="New纽约moving" data-valign="top"></span>
  7.       <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></a></span> </ A></span>
  8.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></li></span> </ LI></span>
  9.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><li></span> <LI></span>
  10.       <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><a href="02.jpg"></span> <a href="02.jpg"></span>
  11.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><img src="02b.jpg" title="New York traffic" data-valign="bottom"></span> <img src="02b.jpg" title="New纽约traffic" data-valign="bottom"></span>
  12.       <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></a></span> </ A></span>
  13.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></li></span> </ LI></span>
  14.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><li></span> <LI></span>
  15.       <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><a href="03.jpg"></span> <a href="03.jpg"></span>
  16.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><img src="03b.jpg" title="Street dancers"></span> <img src="03b.jpg" title="Street dancers"></span>
  17.       <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></a></span> </ A></span>
  18.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></li></span> </ LI></span>
  19.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">...</span> ... ...</span>
  20.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></ul></span> </ UL></span>
  21.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><div id="pointer"></div></span> <div id="pointer"> </ DIV></span>
  22. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></div></span> </ DIV></span>
复制代码

最后,我们的地方,暂停和卷管理环节。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><div id="pause"><a href="#">Paused</a></div></span> <div id="pause"> <a href="#">暂停</ A> </ DIV></span>

  2. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><div id="volume"><a href="#">Sounds</a></div></span> <div id="volume">的<a href="#">声音</ A> </ DIV></span>
复制代码

CSS部分

首先,我们定义标题的一部分,这是一个黑色的背景放置在屏幕底部的风格。 我们使用“RGBA”符号,这使我们能够设置颜色的透明度。 请注意,我们在前面加上旧的浏览器,它由标准的十六进制表示法#000。

标题将在谷歌字体收集从超漂亮的字体:

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#title {</span> #标题{</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: #000;</span>背景:#000;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: rgba(0, 0, 0, 0.8);</span>背景:RGBA(0,0,0,0.8);</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">bottom: 0px;</span>底部:0px;</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">font: 11px Arial, Helvetica, sans-serif;</span>字体:11px宋体,黑体,sans - serif字体;</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">padding: 10px 20px;</span>填充:10px 20像素;</span>
  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">position: fixed;</span>位置:固定;</span>
  8.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">right: 0px;</span>右:0px;</span>
  9.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">text-align: right;</span>文本对齐:权利;</span>
  10.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 100%;</span>宽度:100%;</span>
  11. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  12.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#title h1 {</span> #标题H1 {</span>
  13.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">font: 30px 'Ultra', Arial, serif;</span>字体:30px“超”,宋体,衬线;</span>
  14.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">margin: 0;</span>保证金:0;</span>
  15.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">padding: 0;</span>填充:0;</span>
  16.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

我们将遵循同样的技术为缩略图。 该列表中的元素是浮动显示单杠的图片。
  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#thumbnails {</span> #缩略图{</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: #000;</span>背景:#000;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: rgba(0, 0, 0, 0.8);</span>背景:RGBA(0,0,0,0.8);</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">height: 90px;</span>高度:90px;</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">left: 0;</span>左:0;</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">overflow: hidden;</span>溢出:隐藏;</span>
  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">position: fixed;</span>位置:固定;</span>
  8.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">top: 0;</span>顶部:0;</span>
  9.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 100%;</span>宽度:100%;</span>
  10. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  11.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#thumbnails ul {</span> #缩略图UL {</span>
  12.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">margin: 0;</span>保证金:0;</span>
  13.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">padding: 0;</span>填充:0;</span>
  14.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  15.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#thumbnails li {</span> #缩略图李{</span>
  16.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">float: left;</span>浮动:左;</span>
  17.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">list-style: none;</span>列表样式:无;</span>
  18.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">margin: 5px;</span>保证金:5px;</span>
  19.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">padding: 0;</span>填充:0;</span>
  20.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  21.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#thumbnails a {</span> #缩略图A {</span>
  22.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">outline: none;</span>概要:无;</span>
  23.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  24.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#thumbnails img {</span> #缩略图IMG {</span>
  25.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 112px;</span>宽度:112px;</span>
  26.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

指针被放在了页面。 这将是动画在幻灯片的开始和移动根据当前显示的幻灯片。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#pointer {</span> #指针{</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">border: 2px solid #F30;</span>边境:2px的固体#F30;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">cursor: pointer;</span>光标:指针;</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">height: 75px;</span>高度:75px;</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">left: -100px;</span>左:- 100px的;</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">margin: 3px;</span>保证金:3px;</span>
  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">position: absolute;</span>位置:绝对;</span>
  8.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 112px;</span>宽度:112px;</span>
  9. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

闪光效果是纯白色的整个屏幕固定的div。 默认情况下它是隐藏的。 它将会显示和动态淡出。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#flash {</span> #闪光灯{</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: #FFF;</span>背景:#FFF;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">display: none;</span>显示:无;</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">height: 100%;</span>身高:100%;</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">position: fixed;</span>位置:固定;</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 100%;</span>宽度:100%;</span>
  7. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

同样的想法,认为暂停文字。 它是默认隐藏。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#pause {</span> #暂停{</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">display: none;</span>显示:无;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">font: 100px 'Ultra', arial, serif;</span>字体:100px的“超”,宋体,衬线;</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">height: 100%;</span>身高:100%;</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">opacity: 0.4;</span>不透明度:0.4;</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">position: absolute;</span>位置:绝对;</span>
  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">text-align: center;</span>文本对齐:中心;</span>
  8.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">text-shadow: 0 0 5px #000;</span>文字阴影:0 0 5px#000;</span>
  9.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 100%;</span>宽度:100%;</span>
  10. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  11.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#pause a {</span> #暂停{</span>
  12.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">color: #FFF;</span>颜色:#FFF;</span>
  13.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">height: 100px;</span>高度:100像素;</span>
  14.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">left: 50%;</span>左:50%;</span>
  15.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">margin: -50px 0 0 -250px;</span>利润率:50像素0 0 - 250像素;</span>
  16.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">position: absolute;</span>位置:绝对;</span>
  17.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">text-transform: uppercase;</span>文本转换:大写;</span>
  18.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">top: 50%;</span>顶部:50%;</span>
  19.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 500px;</span>宽度:500px;</span>
  20.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

对于体积联系,我们将使用一些漂亮的图标。 音量按钮显示不同的图标由三个类定义了三个国家。 我们使用CSS精灵技术,以减少PNG加载的文件的数量。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#volume {</span> #卷{</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">left: 10px;</span>左:10px;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">opacity: 0.8;</span>不透明度:0.8;</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">position: absolute;</span>位置:绝对;</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">top: 100px;</span> TOP:100px的;</span>
  6. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#volume a {</span> #卷{</span>
  8.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: transparent url(../img/icons.png) no-repeat;</span>背景:透明的url(.. / IMG / icons.png)不重复;</span>
  9.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">display: block;</span>显示:块;</span>
  10.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">height: 30px;</span>高度:30px;</span>
  11.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">text-indent: -9999px;</span>文本缩进:- 9999px;</span>
  12.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">width: 30px;</span>宽度:30px;</span>
  13.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  14.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#volume.all a {</span> #volume.all A {</span>
  15.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background-position: 0 0;</span>背景位置:0;</span>
  16.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  17.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#volume.some a {</span> #volume.some Å {</span>
  18.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background-position: -30px 0;</span>背景位置:30px 0;</span>
  19.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  20.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#volume.none a {</span> #volume.none {</span>
  21.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background-position: -60px 0;</span>背景位置:60px 0;</span>
  22.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

最后,我们将自订拉斯维加斯的一些默认的样式调整叠加模式和加载指示器的位置。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">.vegas-loading {</span> 。拉斯维加斯加载{</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">top: auto;</span>顶部:自动;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">bottom: 40px;</span>底部:40px;</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">left: 40px;</span>左:40px;</span>
  5. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  6. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">.vegas-overlay {</span> 。拉斯维加斯叠加{</span>
  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background-image: url(../js/vegas/overlays/02.png);</span>背景图像:网址(../js/vegas/overlays/02.png);</span>
  8. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

同时,我们将作一些调整JScrollPane的默认样式,以得到一个不错的滚动装修我们的画廊。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">.jspHorizontalBar {</span> 。jspHorizo​​ntalBar {</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">height: 5px;</span>高度:5px;</span>
  3. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">.jspHorizontalBar .jspTrack {</span> jspHorizo​​ntalBar。jspTrack {</span>
  5.          <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: #333;</span>背景:#333;</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">.jspHorizontalBar .jspDrag {</span> jspHorizo​​ntalBar。jspDrag {</span>
  8.          <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: #666;</span>背景:#666;</span>
  9.          <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">cursor: ew-resize;</span>光标:EW -调整大小;</span>
  10.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  11. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">#thumbnails:hover .jspHorizontalBar .jspDrag {</span> #缩略图。悬停jspHorizo​​ntalBar jspDrag {</span>
  12.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">background: #F30;</span>背景:#F30;</span>
  13. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
复制代码

Javascript部分

我们到达的主要部分:在JavaScript。 让我们先通过缓存一些元素。 图片数组将容纳所有的幻灯片和他们的标题和垂直对齐。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">var pictures = [],</span> VAR图片= []</span>
  2.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$pointer = $( '#pointer' ),</span>指针= $('#指针“),</span>
  3.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$thumbnails = $( '#thumbnails' ),</span>美元缩略图= $('#缩略图“),</span>
  4.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$title = $( '#title' ),</span>标题= $(“#标题”),</span>
  5.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$pause = $( '#pause' ),</span>美元暂停= $('#停顿'),</span>
  6.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$flash = $( '#flash' ),</span>闪光灯= $('#闪光“),</span>
  7.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$volume = $( '#volume' );</span>体积= $(“#卷”);</span>
复制代码

它的时间来定义使用Buzz我们的画廊的声音。现在所有的现代浏览器支持HTML5的音频元素。支持在本机的方式,而不需要对Flash的声音。不幸的是,不是一个单一的所有支持的音频格式。MP3会是一个不错的选择,但Firefox不支持它。我们有我们的声音转换成多种格式的。最佳的组合是OGG和MP3格式。 要转换音频元素,我们使用免费的在线文件转换器在线转换。

BUZZ使我们集团的声音,为了方便地控制他们。 这是我们做所有的相机声音。

如果用户的浏览器不支持HTML5的音频元素,巴斯适当的降低。 在这种情况下,我们将简单地隐藏音量按钮。

交通播放声音,只要它是加载循环。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">buzz.defaults.formats = [ 'ogg', 'mp3' ]; var trafficSound = new buzz.sound( 'sounds/traffic' ), clickSound = new buzz.sound( 'sounds/click' ), focusSound = new buzz.sound( 'sounds/focus' ), rewindSound = new buzz.sound( 'sounds/rewind' ), cameraSounds = new buzz.group( clickSound, focusSound, rewindSound ); if ( !buzz.isSupported() ) { $volume.hide(); }</span> buzz.defaults.formats = ['OGG“,”MP3“]; VAR trafficSound =新buzz.sound(”声音/交通'),clickSound =新buzz.sound(“声音/点击”),focusSound =新的嗡嗡声。声音(声音/聚焦“),rewindSound =新buzz.sound(声音/倒带),cameraSounds =新buzz.group(clickSound,focusSound,rewindSound);如果(!buzz.isSupported()){$卷。 ();}</span>
复制代码
  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">trafficSound.loop().play().fadeIn( 5000 );</span>发挥()。trafficSound.loop()fadeIn(5000);</span>
复制代码

现在,让我们的工作对我们的缩略图。 我们必须调整的总宽度的缩略图栏。 如果没有这一步,缩略图会显示在多个行。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$thumbnails.find( 'ul' ).width( function() {</span>美元thumbnails.find(“UL”)。宽度(函数(){</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">var totalWidth = 0;</span> VAR totalWidth = 0;</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( this ).find( 'li' ).each( function() {</span> $(本)(“礼”)。(函数(){</span>
  4.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">totalWidth += $( this ).outerWidth( true );</span> totalWidth + = $(本)outerWidth(TRUE);</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">return totalWidth;</span>返回totalWidth;</span>
  7. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
复制代码

我们现在申请的JScrollPane的缩略图容器。JScrollPane中提供了一个简单的工作方式与它的API。我们,为了呈现一个适当的调整窗口的大小时,滚动使用。这个API将在进一步的有用。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$thumbnails.jScrollPane();</span> $ thumbnails.jScrollPane();</span>

  2. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">var jScrollPaneApi = $thumbnails.data( 'jsp' );</span> VAR jScrollPaneApi = $ thumbnails.data(“JSP”);</span>

  3. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( window ).bind( 'resize', function() {</span> $(窗口)。绑定(“调整大小”,函数(){</span>
  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">jScrollPaneApi.reinitialise();</span> jScrollPaneApi.reinitialise();</span>
  5. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
复制代码

现在,拉斯维加斯插件需要设置。我们将填补从缩略图列表中抓住一些资料图片数组,并把它传递到拉斯维加斯以开始播放幻灯片。4秒的延迟,应用之间的幻灯片。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$thumbnails.find( 'a' ).each( function() {</span>美元thumbnails.find('A')(函数(){</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">pictures.push({</span> pictures.push({</span>
  3.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">src: $( this ).attr( 'href' ),</span> SRC:$(本)ATTR('href'的),</span>
  4.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">title: $( this ).find( 'img' ).attr( 'title' ),</span>标题:$(本)(“IMG”)ATTR(“标题”),。</span>
  5.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">valign: $( this ).find( 'img' ).data( 'valign' )</span> VALIGN:$(本)(“IMG”)的数据(“VALIGN”)。</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
  7. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">})</span> })</span>

  8. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$.vegas( 'slideshow', {</span>美元。拉斯维加斯(“幻灯片”,{</span>
  9.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">backgrounds: pictures,</span>背景:图片,</span>
  10.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">delay: 4000</span>延迟:4000</span>
  11. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">})( 'overlay' );</span> })(“覆盖”);</span>
复制代码

拉斯维加斯触发一堆的事件。我们现在需要的是一个onload事件触发时加载和显示幻灯片。随着加载的图像的src属性,我们将得到目前活跃的缩略图的数量。此外,播放声音。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( 'body' ).bind( 'vegasload', function( e, img ) {</span> $(“体”)绑定(“vegasload”,功能(E,IMG){</span>
  2.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">var src = $( img ).attr( 'src' ),</span> VAR SRC = $(IMG)。ATTR('src'中),</span>
  3.        <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">idx = $( 'a[href="' + src + '"]' ).parent( 'li' ).index();</span> IDX = $('A [HREF =“”+ SRC +']')父(“礼”)指数()。</span>
复制代码
  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"> focusSound.play();</span> focusSound.play();</span>

  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">// ...</span> / / ...</span>
  3. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
复制代码

标题被修改,以持有的图片标题和显示是一个很好的fade-out/fade-in效果。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"> $title.fadeOut( function() {</span> title.fadeOut(函数(){</span>
  2.        <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( this ).find( 'h1' ).text( pictures[ idx ].title );</span> 。$(本)(“H1”)的文本(图片[idx的称号。);</span>
  3.        <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( this ).fadeIn();</span> $(本)fadeIn();</span>
  4.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
复制代码

闪光灯闪光... ...

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"> $flash.show().fadeOut( 1000 );</span>美元flash.show()淡出(1000)。</span>
复制代码

指针移到当前的缩略图。 JScrollPane的空气污染指数是用来自动滚动栏指针是关闭屏幕,但如果用户将鼠标悬停在酒吧。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"> var pointerPosition = $thumbnails.find( 'li' ).eq( idx ).position().left;</span> VAR pointerPosition美元thumbnails.find(“礼”)EQ(IDX)的位置()离开了。。;</span>

  2.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$pointer.animate({</span> pointer.animate(,</span>
  3.        <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">left: pointerPosition</span>左:pointerPosition</span>
  4.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}, 500, 'easeInOutBack' );</span> },500,'easeInOutBack');</span>

  5.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">if ( ( pointerPosition > $thumbnails.width()</span> ((pointerPosition> $ thumbnails.width()</span>
  6.        <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">|| pointerPosition < jScrollPaneApi.getContentPositionX() )</span> | | pointerPosition <jScrollPaneApi.getContentPositionX())</span>
  7.        <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">&& !$thumbnails.is( ':hover' ) ) {</span> !&&$ thumbnails.is(':悬停')){</span>
  8.            <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">jScrollPaneApi.scrollToX( pointerPosition, true );</span> jScrollPaneApi.scrollToX(pointerPosition,TRUE);</span>
  9.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>

  10.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$pointer.click( function() {</span> $ pointer.click(函数(){</span>
  11.        <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$thumbnails.find( 'a' ).eq( idx ).click()</span>美元thumbnails.find('A')。EQ(IDX)。单击()</span>
  12.    <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
复制代码

让我们看看我们做我们的音量按钮。我们的想法是静音或取消静音按钮被点击的一些声音。 我们改变按钮的类,并设置静音或播放相应的声音。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$volume.click( function() {</span> $ volume.click(函数(){</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">if ( $( this ).hasClass( 'all' ) ) {</span> ($(本)。hasClass(“全部”)){</span>
  3.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">cameraSounds.unmute();</span> cameraSounds.unmute();</span>
  4.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">trafficSound.mute();</span> trafficSound.mute();</span>

  5.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( this ).removeClass( 'all' ).addClass( 'some' );</span> $(本)removeClass addClass(“一些”)(“全部”)。</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">} else if ( $( this ).hasClass( 'some' ) ) {</span>代码} else if($(本)。hasClass(“一些”)){</span>
  7.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">cameraSounds.mute();</span> cameraSounds.mute();</span>
  8.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">trafficSound.mute();</span> trafficSound.mute();</span>

  9.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( this ).removeClass( 'some' ).addClass( 'none' );</span> $(本)removeClass addClass(“一些”)(“无”)。</span>
  10.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">} else {</span> }否则{</span>
  11.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">cameraSounds.unmute();</span> cameraSounds.unmute();</span>
  12.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">trafficSound.unmute();</span> trafficSound.unmute();</span>

  13.         <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$( this ).removeClass( 'none' ).addClass( 'all' );</span> $(本)removeClass addClass(“全部”)(“无”)。</span>
  14.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">}</span> }</span>
  15.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">return false;</span>返回false;</span>
  16. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">});</span> });</span>
复制代码

几乎是我们的画廊。现在,我们希望,点击缩略图显示一个新的幻灯片,并暂停幻灯片。其Cursor设置为目前点击缩略图。这样的幻灯片将在合适的位置重新启动。所有的页面元素是隐藏的,我们显示了一个“暂停”的消息。

另一种播放声音。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$thumbnails.find( 'a' ).click( function() { $pause.show(); $pointer.hide(); $volume.animate( { top: '20px' }); $thumbnails.animate( { top: '-90px' }); $title.animate( { bottom: '-90px' }); var idx = $( this ).parent( 'li' ).index(); $.vegas( 'slideshow', { step: idx } )( 'pause' ); rewindSound.play(); return false; });</span>美元thumbnails.find('A')(函数(){$ pause.show(); $ pointer.hide(); volume.animate({:'20px'}); thumbnails.animate({顶部:'- 90px'});美元title.animate({底部:。'- 90px'}); VAR IDX = $()父(“礼”)指数(); $拉斯维加斯(“幻灯片” {步骤:IDX})(“暂停”); rewindSound.play();返回false;});</span>
复制代码

再次点击“暂停”一词重新启动幻灯片,缩略图和标题显示。

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$pause.click( function() {</span> $ pause.click(函数(){</span>
  2.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$pause.hide();</span>美元pause.hide();</span>
  3.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$pointer.show();</span>美元pointer.show();</span>

  4.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$volume.animate( { top:'100px' });</span> volume.animate({顶部:'100px'});</span>
  5.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$title.animate( { bottom:'0px' });</span> title.animate({底部:0 PX'});</span>
  6.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$thumbnails.animate( { top:'0px' });</span> thumbnails.animate({顶部:0 PX'});</span>

  7.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">$.vegas( 'slideshow' );</span>拉斯维加斯(“幻灯片”)。</span>

  8.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">clickSound.play();</span> clickSound.play();</span>

  9.     <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">return false;</span>返回false;</span>
  10. <s
更多
7

鲜花

握手

雷人

路过

鸡蛋

刚表态过的朋友 (7 人)

发表评论

最新评论

引用 W_snowing 2012-2-18 20:24
没有效果展示没有图片,只能让人拿代码自己弄着看么...
引用 aulence 2012-2-28 12:14
现在的技术网站基本上都有Demo展示了,HTML5中国要跟上潮流啊。
引用 mikeshi 2012-2-28 16:03
怎么感觉是金山词霸的翻译成果啊
引用 Cr@ig偉Defy 2012-2-29 18:59
工程浩大,。,。
引用 jellyzi 2012-3-17 19:32
能提供完整的网页看就更好
引用 禾苗 2012-4-13 15:54
确实有点繁琐呀!
引用 胡小易 2012-4-14 14:49
这个工程大啊........
引用 timeless397 2012-4-15 23:57
有效果演示的啊,上面不是写了效果演示么,不要五毛啊,我估计楼主是直接用翻译软件翻译过来的,大家不要计较太多,学习学习,这是直接网址http://bbs.html5cn.org/thread-2774-1-1.html
引用 Call_Me_橡皮人 2012-4-26 15:56
果然是翻译的啊,楼主 你也用点心 啊 。
引用 btfball 2012-7-27 00:08
其实不用这么繁琐吧……

查看全部评论(10)

HTML5中国微信

小黑屋|关于我们|HTML5论坛|友情链接|手机版|HTML5中国 ( 京ICP备11006447号 京公网安备:11010802018489号  

GMT+8, 2017-2-22 12:26

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

返回顶部