我有一个可滚动(jQuery 工具)中的项目列表...它一次显示 3 个项目/数字,当单击下一个按钮时,它显示下一个 3...
我想要做的事情是,例如,我想要调用一个 web 服务,当可滚动区域内显示的项目、未显示在可滚动区域中的项目应该什么都不做 - 只有在单击下一步按钮时,并显示下 3 个项目...
我的 HTML 输出如下所示:
<div id="adbelt">
<div class="ad-container">
<div id="prevnext">
<a class="next carouselbutton"><span>next</span></a>
<a class="prev carouselbutton"><span>prev</span></a>
</div>
<div id="belt">
<div class="scrollable" id="scrollable">
<div class="items">
<figure>
<a target="_blank" title="http://www.dis-play.dk/" href="http://www.dis-play.dk/">
</a>
<figcaption>
<span>Skarp</span>
<div class="fig-text">og lige til</div>
</figcaption>
<input type="hidden" name="ctl10$phadlist_0$hiddenFieldAdGuid" id="ctl10_phadlist_0_hiddenFieldAdGuid" value="B2A276D78E764528900B723F144117A7" />
</figure>
<figure>
<a target="_blank" title="DIS/Play" href="http://www.dis-play.dk">
<img src="~/media/DISPLAY/Default/defaultAdImage.ashx" class="slide-banner" alt="Kaffe" width="300" height="150" />
</a>
<figcaption>
<span>Forbrugsforeningen 2</span>
<div class="fig-text">har det hele</div>
</figcaption>
<input type="hidden" name="ctl10$phadlist_1$hiddenFieldAdGuid" id="ctl10_phadlist_1_hiddenFieldAdGuid" value="75011C876D04465D865B34FA6DC2CBE3" />
</figure>
<figure>
<a target="_blank" title="http://www.dis-play.dk/" href="http://www.dis-play.dk/">
</a>
<figcaption>
<span>Skarp</span>
<div class="fig-text">og lige til</div>
</figcaption>
<input type="hidden" name="ctl10$phadlist_2$hiddenFieldAdGuid" id="ctl10_phadlist_2_hiddenFieldAdGuid" value="B2A276D78E764528900B723F144117A7" />
</figure>
<figure>
<figcaption>
<span></span>
<div class="fig-text"></div>
</figcaption>
<input type="hidden" name="ctl10$phadlist_3$hiddenFieldAdGuid" id="ctl10_phadlist_3_hiddenFieldAdGuid" value="BE7DA9601D4840B981A1E5305E01786F" />
</figure>
<figure>
<a target="_blank" title="DIS/Play" href="http://www.dis-play.dk">
<img src="~/media/DISPLAY/Default/defaultAdImage.ashx" class="slide-banner" alt="Kaffe" width="300" height="150" />
</a>
<figcaption>
<span>Forbrugsforeningen 2</span>
<div class="fig-text">har det hele</div>
</figcaption>
<input type="hidden" name="ctl10$phadlist_4$hiddenFieldAdGuid" id="ctl10_phadlist_4_hiddenFieldAdGuid" value="75011C876D04465D865B34FA6DC2CBE3" />
</figure>
<figure>
<figcaption>
<span></span>
<div class="fig-text"></div>
</figcaption>
<input type="hidden" name="ctl10$phadlist_5$hiddenFieldAdGuid" id="ctl10_phadlist_5_hiddenFieldAdGuid" value="BE7DA9601D4840B981A1E5305E01786F" />
</figure>
</div>
</div>
</div>
</div>
我试过这个:
$("#belt figure").each(function () {
if ($(this).filter(':visible')) {
alert("visible");
//Do something, like calling a webservice
} else {
alert("not visible");
//Dont call webservice
}
});
我试过查看 jquery.appear 插件,但它似乎不支持我想要的东西?