【发布时间】:2013-05-18 06:00:07
【问题描述】:
我有以下setup,它运行良好,cookie 部分除外。 JQuery 由以下脚本控制:
$(document).ready(function () {
$("#headershadow").hide();
$("#greenbanner").show();
$("#bigx").click(function () {
$("#greenbanner").hide(1000);
$("#headershadow").show(500);
$.cookie('greencookie', 'true', {
expires: 1,
path: '/'
});
});
});
这是 HTML:
<img src="<?php bloginfo('template_directory'); ?>/HeaderShadow.png" id="headershadow" />
<div id="greenbanner">
<img src="<?php bloginfo('template_directory'); ?>/Devices.png" id="devices">
<img src="<?php bloginfo('template_directory'); ?>/bigx.png" id="bigx">
<div id="bannertext">Spundge lets you discover, <br />curate, and create better content. <br /><br /><div id="jointhedarkside"><a style="color:#ffffff;" href="https://www.spundge.com/account/signup/">Get Started - It's Free</a></div> </div>
</div>
我正在使用来自 GitHub 的 following cookies JQuery plugin,我似乎能够正确设置 cookie,但我不知道如何设置代码以便网页识别 cookie 并且不加载#greenbannerdiv。我尝试过的所有 if/else 组合都没有用。
请帮忙!
【问题讨论】:
标签: jquery html css wordpress cookies