如何用JavaScript实现旋转木马
时间:2019-11-14 12:36:41 来源:未知 作者:站长技术网 点击:次
Flash动画可以让Web网站看起来很漂亮,但是由于各种原因不是每个人都会在自己的客户端浏览器上安装Flash播放器。如果你或者你的用户不幸安装了64位的Linux发行版,或者你痛恨在自己的Web页面上放动画,那么你就不得不面对没有Flash动画的情况了。 在本文里,我将告诉你如何用JavaScript实现一个可用性更高的旋转木马(carousel)而弃用Flash。 JavaScript——两害相交取其轻 在本文里,我不准备去争论为什么要开发一个旋转木马,而是要接受我们不得不去开发的事实。 那么问题就来了:为什么要使用JavaSript而不是Flash?
HTML基础 知道了这些原因,就让我们从将要在本文中用到的四个内容开始创建旋转木马吧。 Secure IIS Log files are essential to reconstruct events before an IIS Web server failure. Learn how to protect your log files with this tip. Full story User Group Mash Find an Aussie user group near you with our new Google maps interface. Full story .NET 101 Learn how the .NET Framework works and the tools you'll need to get up and running in this quick start guide. Full story Understand CSS Before diving into CSS learn some of the core drivers and concepts. Full story 这个时候蒙娜丽莎对我们还没有用。现在让我们向这些div加入一些样式,让它看起来更像我们所知道的旋转木马: .storydiv { height:182px; width:355px; padding-left:175px; top:0px; left:0px; } #story1 { background:url(http://www.builderau.com.au/i/s/cov/securitychain170110.gif) no-repeat; } #story2 { background:url(http://www.builderau.com.au/i/s/cov/browser170110.jpg) no-repeat; } #story3 { background:url(http://www.builderau.com.au/i/s/cov/dotnet170110.gif) no-repeat; } #story4 { background:url(http://www.builderau.com.au/i/s/cov/tools170110.jpg) no-repeat; } .storyDesc{ padding-top: 10px; padding-right: 8px; display:block; } .fStory { padding-top: 10px; display:block; font-weight:bold; }
Secure IIS Log files are essential to reconstruct events before an IIS Web server failure. Learn how to protect your log files with this tip. Full story User Group Mash Find an Aussie user group near you with our new Google maps interface. Full story .NET 101 Learn how the .NET Framework works and the tools you'll need to get up and running in this quick start guide. Full story Understand CSS Before diving into CSS learn
Full story
|