如何允许用户使用此 JQuery 示例关闭幻灯片?
我想让用户注册我的电子邮件通讯,而不使用烦人的弹出窗口。
我发现了一个滚动激活的 JQuery 幻灯片,我认为它会很好用。
这是我创建的测试示例:(向下滚动以激活它)
http://buckinvestor.com/test/ jquerytest.html
现在的问题是:我不想因为在每个页面上不断地向下滑动而惹恼用户。
如何向幻灯片添加“关闭”按钮?
如何确保用户在单击关闭后不会再次看到幻灯片? (也许是一个保持活动状态 7 天之类的 cookie?,不确定它是如何工作的,但如果你给我提供一些指导,我会弄清楚)。
谢谢大家 - StackOverflow 真是一个救星!
I would like to get users to sign up to my email newsletter without using annoying popups.
I discovered a scroll-activated JQuery slide that I think will work well.
Here is the test example I created: (scroll down to activate it)
http://buckinvestor.com/test/jquerytest.html
Now here is the problem: I don't want to annoy users by constantly having this slide down on each page.
How do I add a "Close" button to the slide?
How do I ensure that the user doesn't see the slide again after they click close? (perhaps a cookie that stays active for 7 days or something?, not sure how that works, but if you provide me some guidance, I'll figure it out).
Thank you everyone - StackOverflow has been such a lifesaver!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
很简单,
你只需要隐藏 DIV
在此示例中,添加一个按钮或图像,并使用 live('click',function(){})
作为问题的第二部分 yes cookie
Easy
you just need to hide the DIV
in this example add a button or image and use the live('click',function(){})
as for the second part of the question yes cookie
对于#1,只需添加一个按钮并
单击即可隐藏作为幻灯片的 div。
For #1, just add a button and
onclick to hide the div that is the slide thing.
添加
或
Add a
<a>
or<button>
or something for the close button inside of the #headerSlideContent<div>
Add a on click or similar to the button inside your load function:
http://api.jquery.com/hide/
For part 2, yes a cookie is good, I found the jQuery cookie plugin to be helpful: http://plugins.jquery.com/project/Cookie
Set the cookie:
$.cookie("name", "value");
Read the cookie:
var value = $.cookie("name");