我想在每个中继器项目上调用jquery [英] i want to call jquery on each repeater item

查看:70
本文介绍了我想在每个中继器项目上调用jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



请检查以下代码并给我建议开发此代码的建议...

 <   asp:DataList     ID   =  dl_Videos    runat   = 服务器 >  
< itemtemplate >
< asp:Panel ID = pnl_Video 样式 = margin: 5px runat = server > < < span class =code-leadattribute> / asp:Panel >

< script type = text / javascript >
$( document )。ready( function (){
jQuery < b>( #<%= pnl_Video.ClientID%>)。 tubeplayer({
宽度: 210 // 宽度播放器
height: 200 // 播放器的高度
allowFullScreen: true
initialVideo: <%# Eval('My_Url') %>>,
preferredQuality: 默认
});
});
< / script >
< / ItemTemplate >
< / DataList >

解决方案

document )。ready( function (){
jQuery #<%= pnl_Video.ClientID%> .tubeplayer({
width: 210 // 播放器的宽度
height: 200 // 播放器的高度
allowFullScreen: true
initialVideo: <%# Eval('My_Url')%> ;>,
preferredQuality: 默认
});
});
< / script >
< / ItemTemplate >
< / DataList >


您可以使用jquery .each方法。它将遍历从选择器返回的所有元素。



http: //api.jquery.com/each/ [ ^ ]

hello all,

please check following code and give me suggetions for developing this code...

<asp:DataList ID="dl_Videos" runat="server">
    <itemtemplate>
        <asp:Panel ID="pnl_Video" Style="margin: 5px" runat="server"> </asp:Panel> 

<script type="text/javascript">
$(document).ready(function () {
    jQuery("#<%= pnl_Video.ClientID%>").tubeplayer({
        width: 210, // the width of the player
        height: 200, // the height of the player
        allowFullScreen: "true", 
        initialVideo: "<%#Eval('My_Url')%>">, 
        preferredQuality: "default", 
    });
});
</script>
    </ItemTemplate>
</DataList>

解决方案

(document).ready(function () { jQuery("#<%= pnl_Video.ClientID%>").tubeplayer({ width: 210, // the width of the player height: 200, // the height of the player allowFullScreen: "true", initialVideo: "<%#Eval('My_Url')%>">, preferredQuality: "default", }); }); </script> </ItemTemplate> </DataList>


You can use the jquery .each method. It will iterate over all elements that are returned from your selector.

http://api.jquery.com/each/[^]


这篇关于我想在每个中继器项目上调用jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆