最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

HTML5的音频和JQUERY的全屏幻灯片-H5教程

来源:http://erdangjiade.com/topic/133829.html H5程序员 2017-10-26 09:09浏览(38)

在今天的教程中,我们将创建一个全屏的照片幻灯片来说明纽约图片系列。 我们将增加对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"><p id="title"></span> <p 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"></p></span> </ DIV></span>

复制代码


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

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

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><p id="flash"></p></span> <p id="flash"> </ DIV></span>
  2. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><p id="thumbnails"></span> <p 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"><p id="pointer"></p></span> <p id="pointer"> </ DIV></span>
  22. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"></p></span> </ DIV></span>

复制代码


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

  1. <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><p id="pause"><a href="#">Paused</a></p></span> <p 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"><p id="volume"><a href="#">Sounds</a></p></span> <p 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>

复制代码


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

  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
评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2