Jqueryui和cookie状态

时间:2011-02-10 22:16:29

标签: javascript jquery jquery-ui cookies

我有这些代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Toggle</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="http://www.lywomen.com/js/jquery-ui.min.js"></script>
<style type="text/css">
    .toggler { width: 500px; height: 200px; }
    #button { padding: .5em 1em; text-decoration: none; }
    #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; }
    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
    </style>
</head>

<body>
    <script type="text/javascript">
jQuery.noConflict();
    jQuery(function() {
        //run the currently selected effect
        function runEffect(){
            //get effect type from
            var selectedEffect = 'slide';

            //most effect types need no options passed by default
            var options = {};
            //check if it's scale or size - they need options explicitly set
            if(selectedEffect == 'scale'){  options = {percent: 0}; }
            else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; }

            //run the effect
            jQuery("#effect").toggle(selectedEffect,options,500);

        };

        //set effect from select menu value
        jQuery("#button").click(function() {
            jQuery(this).toggleClass("clickedbuttons")
            runEffect();
            return false;
        });

    });
    </script>

<div class="demo">

<div class="toggler">
    <div id="effect" class="ui-widget-content ui-corner-all">
        <h3 class="ui-widget-header ui-corner-all">Toggle</h3>
        <p>
            Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
        </p>
    </div>
</div>

<a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
</div><!-- End demo -->

</body>

</html>

它的幻灯片效果显示和隐藏我想要它像vbulletin.com/forum

当您单击隐藏其仍然是hiddin时,直到您单击显示为您的用户选择保存

所以我发现这个链接真的很有帮助

http://www.devcomments.com/q465701/jquery-and-cookie-status

但它与我的效果幻灯片的不同之处你可以只是请将代码保存为代码以保存我的代码请使用vbulletin

您可以查看该链接

www.lywomen.com/f

我的论坛你可以看到左边栏我想给出隐藏和展示的选择

拜托,请帮助我

并且非常感谢

1 个答案:

答案 0 :(得分:0)

检查该链接

http://www.devcomments.com/q465701/jquery-and-cookie-status

你可以找到与vbulletin一起使用的代码你可以管理它,请使用我的代码我已经把html页面的简单例子

谢谢