简体   繁体   English

jQuery选择器帮助

[英]jquery selector help

I have a telerik listview that is generating to much html for my slide show. 我有一个telerik listview,它为幻灯片生成了很多html。 The slide show only should contain two items but it contains 6. I am not sure why it generating extra code, but I was hoping there is a way with jquery to only select the appropriate ones that are created. 幻灯片仅应包含两个项目,但应包含6个项目。我不确定为什么它会生成额外的代码,但是我希望jquery有一种方法可以仅选择要创建的适当代码。 I am using This Slide show, and Here is the markup that creates the slide show. 我正在使用幻灯片放映,这是创建幻灯片的标记。

$(document).ready(function () {
    $('#ctl00_MainContent_PhotoListData_lvSlideShowList_ctrl0_itemPlaceholderContainer').cycle({
        fx: 'fade',
            delay:-1000// choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
});

您不需要对如此长的ID进行硬编码,当您拥有服务器控件时,应该始终使用此ID:

var element = $('#<%=your_sever_control_id.ClientID%>');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM