开发者

How to pass String to jquery image slider in design-View in asp.net

I am trying to pass the text to jquery image slider but i just dont know how to acheive this, Below is the Design view:

      <script type="text/javascript">
                //want to pass text to "desc:"sometext"
               if (!window.slider) var slider = {};
               slider.data = [{ "id": "slide-img-1", "client": "nature beauty", "desc":"" }, 
               { "id": "slide-img开发者_高级运维-2", "client": "nature beauty", "desc": "" },
               { "id": "slide-img-3", "client": "nature beauty", "desc": "" }];

    <asp:Repeater ID="rptJquery" runat="server">

<ItemTemplate>
 <a href="">
<img ID='<%#Eval("slideshowID") %>' src='<%#String.Format("../images/slideshow/{0}", Eval("imgURL"))%>' class="slide"/>
</a> 
    //want to pass this hidden field value to the above "desc" as there are three description
    // for three images , there fore I want to pass specific description to all 3 images
    <asp:HiddenField ID="desc" runat="server" Value='<%#Eval("slideDesc")%>' />
</ItemTemplate>
</asp:Repeater>


<script type="text/javascript">

if(!window.slider) var  slider={};
slider.data = [{ "id": "slide-img-1", "client": "nature beauty", 
          "desc": $('#slide-img-1').parent().next('input[type=hidden]').val() },
          { "id": "slide-img-2", "client": "nature beauty",
          "desc": $('#slide-img-2').parent().next('input[type=hidden]').val() },
          { "id": "slide-img-3", "client": "nature beauty",
          "desc": $('#slide-img-3').parent().next('input[type=hidden]').val() }];
</script>

(Place this code just before the closing </body>tag.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜