我想在Xpages中创建一个旋转木马,从注释视图中获取图片和标题文本。
在我的测试数据库中,我只有2张图片及其相应的文字。
转盘以项目开始:活动图片和文字。
然后开始骑自行车;显示具有相应文本的视图的第二张图片 然后旋转木马消失了 然后它返回并显示视图的第一张图片 然后显示视图的第二张图片和STOPS 我希望它能够顺利地循环 怎么了?
<div id="this-carousel-id" class="carousel slide"><!-- class of slide for animation -->
<div class="carousel-inner">
<!-- eerste afbeelding hard coded -->
<div class="item active"><!-- class of active since it's the first item -->
<img
src="servername/website.nsf/O/2CC047BB85CDD6B9C1257B030055835D/$FILE/Website_banner.jpg"
alt="" />
<div class="container" style="position: static;max-width:550px;padding-left:300px; margin-top:10px">
<div class="carousel-caption" align="center"
style="background-color: transparent;text-align:left">
<h1>Sample1</h1>
<p class="lead">
De nouveaux horizons pour les
enfants
</p>
<a class="btn btn-large btn-primary"
href="#">
More info on sample1
</a>
</div>
</div>
</div>
<xp:repeat value="#{view1}" var="thisDocument"
disableOutputTag="true" first="1">
<div class="item">
<xp:text escape="false"
id="computedField1">
<xp:this.value><![CDATA[#{javascript:thisid= thisDocument.getColumnValue("unid");
thisdocument = thisDocument.getColumnValue("Picture name");
viewScope.put("captiontext", thisDocument.getColumnValue("frontpageText"));
berekendelink= "<img src="+"'servername/website.nsf/O/"+thisid+"/$FILE/"+thisdocument+"' alt='' />";
return berekendelink.toString();}]]></xp:this.value>
</xp:text>
</div>
<xp:text escape="false" id="computedField2">
<xp:this.value><![CDATA[#{javascript:texttodisplay = viewScope.get("captiontext")
return texttodisplay}]]></xp:this.value>
</xp:text>
</xp:repeat>
</div>
</div>
<!-- /.carousel -->
<script>
$(document).ready(function(){ $('.carousel').carousel({
interval: 5000 }); });
</script>
</xp:div>
答案 0 :(得分:0)
似乎它正在使用以下结构:
<div id="carousel" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="item active">
<xp:repeat id="repeat1" value="#{view1}" var="firstDocument" rows="1" first="0">
here I've put a calculated field to calculate the reference of the first picture out of my view
</xp:repeat>
</div>
<xp:repeat value="#{view1}" var="thisDocument" disableOutputTag="true" first="1">
<div class="item">
here I've put a calculated field to calculate the reference of the next pictures out of my view
</div>
</xp:repeat>
</div>
<script>
$(document).ready(function(){ $('.carousel').carousel({
interval: 5000 }); });
</script>
</div>