3

我正在尝试设置全屏 jquery 滑块。我将项目分为两个步骤 1) css 和 2) js。

1) CSS,下面是我正在拍摄的图片(没有固定高度),下面是我到目前为止不起作用的代码。

例子

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <style type="text/css">

        /* Positioning */
        #container { width: 2500px; }
        .block { display: inline; }

        /* Styling */
        .block img { padding: 5px; }

    </style>
</head>
<body>
    <div id="container">
        <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div>
        <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div>
        <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div>
    </div>
</body>
</html>

2) Javascript,使用 jquery 我希望 div 在单击它们时向左滑动......如果可能的话,就像jQuery Coda Slider一样。

谢谢,任何帮助表示赞赏。

4

2 回答 2

0

您需要首先将容器 div 的 css 设置为固定宽度,并将溢出设置为隐藏,以便仅显示该区域内的内容:

#container{
  width:500px;
  height:200px;
  overflow:hidden;
}

您希望滑块如何工作?自动的?按钮按下?有一些插件可能会自动处理它

于 2010-05-17T17:17:23.507 回答
0

看那个东西:http ://apirocks.com/html5/html5.html (用 Chrome 测试)

于 2010-05-17T17:42:58.003 回答