是否有任何代码(CSS或JS)可以阻止元素在视图中被部分遮挡时加载/可见?
在我的网站newsoftheuniverse.blogspot.ca上,我有一个转盘,一次显示几个标题,然后向左移除一个。但是(根据您的屏幕分辨率),最后的标题通常会被切断。是否有一些代码可以添加到#carousel ul li或.river或.pible以防止出现截止标题?
CSS:
#carousel{height:55px; width:100% !important; overflow:hidden; margin: 0 auto}
#carousel ul li{width:300px !important; height:70px; overflow:hidden;}
.cozo {background:rgb(244,244,244); padding:8px 0; border-bottom: 1px solid #eee; margin: 0 5% 0 5%; width: 90%}
.river{font-size:12px; line-height:18.8px;}
.river img{width:65px; height:55px; float:left; margin: 0 12px 12px 0;}
.pible{width:90%;}
.river a{color:#777;}
.river a:hover{color:$(link.color);}
使用Javascript:
<div id='carousel'>
<div class='beek1'>
<script>
document.write(" <script src=\"/feeds/posts/default?max-results="+numposts1+"&orderby=published&alt=json-in-script&callback=showrecentposts\"><\/script>");
</script>
</div>
</div>
<script type='text/javascript'>
(function($) { $(document).ready(function(){
$("#carousel").jCarouselLite({
auto:2600,
scroll: 1,
speed: 2600,
visible: 4,
start: 0,
circular: true,
btnPrev: "#previous_button",
btnNext: "#next_button"
});
})})(jQuery)
</script>
<div class='clear'/>