【发布时间】:2015-06-20 03:40:11
【问题描述】:
我在 asp.net MVC 应用程序的主页中有一个包含 5 张图片的图像滑块。现在,当用户单击应用程序中的其他菜单选项卡时,图像滑块的最后一次看到的图像应该存储在 cookie 中。所以当用户回到主页时,图像滑块将从最后看到的图像开始。我的chtml:
<div id="sliderFrame">
<div id="slider">
<a id="image1" href='#' class='linkdisabled'>
<img src="~/content/Internal/Images/image1.jpg" alt="" />
</a>
<a id="image2" href='#' class='linkdisabled'>
<img src="~/content/Internal/Images/image2.jpg" alt="" />
</a>
.....
我正在考虑通过 cookie 中的 ID 覆盖图像,当用户返回主页时,cookie 中最后存储的图像将显示在图像幻灯片中。 但是如何获取图像 id 并将其存储到 cookie 中?请帮忙。
【问题讨论】:
标签: javascript asp.net-mvc-4 cookies jquery-cookie