将描述文本从数据库传递给jquery图像滑块
Passing the description text to jquery image slider from database
我使用的是jquery图像滑块,我已经弄清楚了,如何将图像从数据库传递到我的图像滑块,但我有问题传递描述文本到每个图像,因为图像形成是在一个脚本中,我不知道如何传递eval("description")到脚本。下面是代码:
<script type="text/javascript">
if (!window.slider) var slider = {};
slider.data = [{ "id": "slide-img-1", "client": "nature beauty", "desc": "With up to 30 used caravans for you to choose from, you will soon be able to hit the open road...<br /> Come along and browse at your leisure or take a look at a selection of our current stock." }, { "id": "slide-img-2", "client": "nature beauty", "desc": "" }, { "id": "slide-img-3", "client": "nature beauty", "desc": "add your description here" }, { "id": "slide-img-4", "client": "nature beauty", "desc": "add your description here" }, { "id": "slide-img-5", "client": "nature beauty", "desc": "add your description here" }, { "id": "slide-img-6", "client": "nature beauty", "desc": "add your description here"}];
所以我想传递类似"desc":'<%eval("description")%>'
<div id="slide-runner">
<asp:Repeater ID="rptJquery" runat="server">
<ItemTemplate>
<a href="">
<img ID='<%#Eval("slideshowID") %>' src='<%#String.Format("/images/slideshow/{0}", Eval("imgURL"))%>' class="slide"/>
</a>
</ItemTemplate>
</asp:Repeater>
</div>
实现此场景的最佳方法是将数据作为JSON提供,并在加载图像滑块时,在初始化时提供此数据。
如果你提供了正确的数据,插件应该可以正确处理这种类型的数据。
如果你能告诉我们你的插件的名字,也许我们可以为你提供一些样品。
相关文章:
- jQuery图像幻灯片,在停止后淡出到第一张图像
- 使用next、prev按钮制作简单的jQuery图像滑块
- Jquery图像循环问题
- 为什么这个jQuery图像映射在WordPress上不起作用
- JQuery 图像错误处理
- jQuery 图像替换为类
- jquery 图像旋转器(仅在 JS 中传递图像)
- jQuery图像在悬停时闪烁
- 使用 nameProp 的 JQuery 图像滚动更新在 Firefox 和 Chrome 中不起作用
- JQuery 图像过渡.向上滑动
- jQuery图像淡入淡出不起作用
- JQuery图像预览无法工作
- JQuery图像滑块和CSS转换只能工作一次
- jQuery图像(产品)滑块
- jQuery-图像替换转换〔Safari中的问题〕
- 使jQuery图像滑块停止在最后一个图像,并添加下一个和上一个按钮
- jquery图像滑块库
- JQuery图像大小计算没有'不能在Chrome/Safari中工作
- 如何使JQuery图像滑块与屏幕的宽度相等
- wordpress插件中的jQuery图像幻灯片