如果部分阻塞,则防止元素显示

时间:2017-08-02 02:58:22

标签: javascript jquery html css

是否有任何代码(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(&quot; &lt;script src=\&quot;/feeds/posts/default?max-results=&quot;+numposts1+&quot;&amp;orderby=published&amp;alt=json-in-script&amp;callback=showrecentposts\&quot;&gt;&lt;\/script&gt;&quot;);
</script>   
</div>
</div>
<script type='text/javascript'>
(function($) {  $(document).ready(function(){
$(&quot;#carousel&quot;).jCarouselLite({
    auto:2600,
    scroll: 1,
    speed: 2600,    
    visible: 4,
    start: 0,
    circular: true,
    btnPrev: &quot;#previous_button&quot;,
    btnNext: &quot;#next_button&quot;
    });
    })})(jQuery)    
</script> 
<div class='clear'/>

0 个答案:

没有答案