English 中文(简体)
使用 c和 j
原标题:slider using css and jquery
  • 时间:2012-04-24 11:22:03
  •  标签:
  • jquery
  • html

i 想要利用 j子进行洗der,即已经做了一些工作,现在就在左子里增加其价值,即:如果li子到尾去,则会屈服于其父母的 right权,如马凯,但胎盘使用。

http://jsfiddle.net/“rel=“nofollow”http://jsfiddle.net/

<head>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
        var left = 0;
        $(function moveable() {

            $( #slider ).css( left , --left);

            setTimeout(moveable, 10)

        })
    </script>
    <style>
        .main {
            margin: 0 auto;
            width: 500px;
            height: 200px;
            border: solid 1px #F00;
            overflow: hidden
        }
        #slider {
            position: relative;
            background: #333;
            height: 200px;
        }

    </style>
</head>
<body>
    <div class="main">
        <div id="slider">
            <img src="slider.jpg" width="500" height="200" />
        </div>
    </div>
</body>
最佳回答

试图这样做

                        <html xmlns="http://www.w3.org/1999/xhtml">
                    <head>
                    <script src="http://code.jquery.com/jquery-latest.js"></script>
                    <style>
                    .main { margin:0 auto; width:500px; height:200px; border:solid 1px #F00; overflow:hidden}
                    #slider {position:relative; background:#333; height:200px;}
                    </style>
                    </head>
                    <body>
                    <div class="main">
                    <div id="slider">
                      <img src="test.png" width="500" height="200" alt="image" id="slider_img" /></div>
                    </div>
                    <script type="text/javascript">
                        var left=0;
                         $("#slider_img").click(function () {
                         $(function moveable(){
                        $( #slider ).css( left  ,--left);
                        setTimeout(moveable,10)
                        });
                        });
                    </script>
                    </body>
                    </html>

单项产出

rel=“nofollow”>http://jsfiddle.net/srinivasan/T7xhW/2/

问题回答

The s have been a jQuery UI slider: http://jqueryui.com/demos/slider/

它运作良好,搭配的选择非常好。 如果对“平等倡议”没有任何限制,我就非常建议使用它。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签