源示例是这样的
// block with caption
var caption_block = "<div class='caption-block'><h1>"+ options.title + "</h1><div class='pages'><a href='/' id='left_pg'></a><div id='counter'>"+ (i+1)+'/'+(elms+1)+"</div><a href='/' id='right_pg'></a></div></div>";
// put the elemnt with caption into the DOM
$('ul.slider').before(caption_block);
// by click in #counter TEST
$('a').bind('click',function(){
$('#slider').find('#counter').text(" TEST ");
});
倒霉,但它什么都不做。
脚本找不到div#counter
. 如何得到它?
html看起来像
<div id="slider"><ul class="slider" /></div>