开发者

I want to use this simple sliding panel. jquery panel

Instead of the panel coming down I want it to go from left to right thanks

<title>Simple Slide Panel</title>

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript">
    $(document).ready(function(){

        $(".btn-slide").click(function(){
            $("#panel").slideToggle("slow");
            $(this).toggleClass("active"); return false;
        });


    });
    </script>

    <style type="text/css">
    body {
        margin: 0 auto;
        padding: 0;
        width: 570px;
        font: 75%/120% Arial, Helvetica, sans-serif;
    }
    a:focus {
        outline: none;
    }
    #panel {
        background: #754c24;
        height: 200px;
        display: none;
    }
    .slide {
        margin: 0;
        padding: 0;
      开发者_如何学JAVA  border-top: solid 4px #422410;
        background: url(images/btn-slide.gif) no-repeat center top;
    }
    .btn-slide {
        background: url(images/white-arrow.gif) no-repeat right -50px;
        text-align: center;
        width: 144px;
        height: 31px;
        padding: 10px 10px 0 0;
        margin: 0 auto;
        display: block;
        font: bold 120%/100% Arial, Helvetica, sans-serif;
        color: #fff;
        text-decoration: none;
    }
    .active {
        background-position: right 12px;
    }
    </style>
    </head>

    <body>

    <div id="panel">
        <!-- you can put content here -->
    </div>

    <p class="slide"><a href="#" class="btn-slide">Slide Panel</a></p>

    </body>
    </html>


Try this

EDIT:

David commented with a good suggestion. The beauty of jQuery is its ability to animate properties of elements. slideup/down/toggle animate the height of elements. Width is another property that can be animated and would give you the horizontal-slide effect you're after. The link I posted is to an article with examples.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜