使用 jquery 循环插件以父 div 为目标
从这里使用 Jquery 循环插件 http://jquery.malsup.com/cycle/begin.html 使用此代码,
jQuery(function($) {
$('#s2').cycle({
fx: 'scrollDown'
});
});
我尝试循环特色属性。我让它工作了,但我只需要带有内部类的容器 div 来循环,而不是其中的所有元素。
<div id="s2">
<div class="inner">
<h2>{title}</h2>
<img src="{image001}" width="250" height="175">
<div id="partial-details">
<ul class="partial-details-a">
<li><span class="bold">ZAR: </span><span class="highlight">{property_price}</span></li>
<li><span class="bold">Web Reference:</span> {web_reference}</li>
<li><span class="bold">Erf Size:</span> {property_erfsize}</li>
<li><span class="bold">Building Size:</span> {property_buildingsize}</li>
</ul>
<ul class="partial-details-a partial-details-b">
<li class="bedrooms">{property_bedrooms}</li>
<li class="bathrooms">{property_bathrooms}</li>
<li class="garages">{property_garages}</li>
</ul>
<h3>Property Details:</h3>
<p>{property_snippet}</p>
<em><a href="#">Details</a></em>
</div><!-- end partial details-->
</div><!-- end inner-->
<div class="inner">
<h2>{title}</h2>
<img src="{image001}" width="250" height="175">
<div id="partial-details">
<ul class="partial-details-a">
<li><span class="bold">ZAR: </span><span class="highlight">{property_price}</span></li>
<li><span class="bold">Web Reference:</span> {web_reference}</li>
<li><span class="bold">Erf Size:</span> {property_erfsize}</li>
<li><span class="bold">Building Size:</span> {property_buildingsize}</li>
</ul>
<ul class="partial-details-a partial-details-b">
<li class="bedrooms">{property_bedrooms}</li>
<li class="bathrooms">{property_bathrooms}</li>
<li class="garages">{property_garages}</li>
</ul>
<h3>Property Details:</h3>
<p>{property_snippet}</p>
<em><a href="#">Details</a></em>
</div><!-- end partial details-->
</div><!-- end inner--></div><!-- end s2-->
Using Jquery cycle plugin from here http://jquery.malsup.com/cycle/begin.html with this code
jQuery(function($) {
$('#s2').cycle({
fx: 'scrollDown'
});
});
I'm trying to cycle featured property. I get it working, but I need only the container div with the class of inner to cycle, not all the elements inside it.
<div id="s2">
<div class="inner">
<h2>{title}</h2>
<img src="{image001}" width="250" height="175">
<div id="partial-details">
<ul class="partial-details-a">
<li><span class="bold">ZAR: </span><span class="highlight">{property_price}</span></li>
<li><span class="bold">Web Reference:</span> {web_reference}</li>
<li><span class="bold">Erf Size:</span> {property_erfsize}</li>
<li><span class="bold">Building Size:</span> {property_buildingsize}</li>
</ul>
<ul class="partial-details-a partial-details-b">
<li class="bedrooms">{property_bedrooms}</li>
<li class="bathrooms">{property_bathrooms}</li>
<li class="garages">{property_garages}</li>
</ul>
<h3>Property Details:</h3>
<p>{property_snippet}</p>
<em><a href="#">Details</a></em>
</div><!-- end partial details-->
</div><!-- end inner-->
<div class="inner">
<h2>{title}</h2>
<img src="{image001}" width="250" height="175">
<div id="partial-details">
<ul class="partial-details-a">
<li><span class="bold">ZAR: </span><span class="highlight">{property_price}</span></li>
<li><span class="bold">Web Reference:</span> {web_reference}</li>
<li><span class="bold">Erf Size:</span> {property_erfsize}</li>
<li><span class="bold">Building Size:</span> {property_buildingsize}</li>
</ul>
<ul class="partial-details-a partial-details-b">
<li class="bedrooms">{property_bedrooms}</li>
<li class="bathrooms">{property_bathrooms}</li>
<li class="garages">{property_garages}</li>
</ul>
<h3>Property Details:</h3>
<p>{property_snippet}</p>
<em><a href="#">Details</a></em>
</div><!-- end partial details-->
</div><!-- end inner--></div><!-- end s2-->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它似乎工作得很好。它只显示内部 div 并将其向下滑动。
its seems to work just fine. its just show only the inner div and slide that down.