0
我正在根據Bootstrap3製作我的第一個WordPress模板。現在我正在嘗試使用instafeed.js添加Instagram Feed。我的問題是讓Instagram Feed與Bootstrap的優勢相適應。任何想法如何改變我的代碼以適應Bootstrap3?我已經嘗試添加引導標籤,但它要麼在一行上顯示所有圖像,要麼在每行上顯示一個圖像(沒有100%寬度)。如何讓Instagram.js Feed在Bootstrap中響應?
HTML(和JS)
<div class="container">
<div class="row">
<div id="instafeed">
</div>
</div>
</div>
<script type="text/javascript">
var feed = new Instafeed({
get: 'tagged',
tagName: 'HASHTAG',
clientId: 'MY_CLIENT_ID',
limit: 6,
template: '<div class="col-md-2"><a href="{{link}}" target="_blank"><img src="{{image}}" class="img-responsive" /><div class="likes">♥ {{likes}}</div></a></div>'
});
feed.run();
</script>
CSS:
#instafeed a {
padding:5px 5px 1px 5px;
margin:10px;
border:1px solid #e1e1e1;
display:inline-block;
border-radius: 4px;
position:relative;
}
#instafeed .likes {
background:rgba(176,76,76,0.8);
font-family:sans-serif;
font-size:1em;
position:absolute;
color:#ffffff;
right:5px;
top:5px;
left:5px;
opacity:0;
text-align:center;
line-height:150px;
text-shadow:0 1px rgba(0,0,0,0.5);
-webkit-font-smoothing:antialiased;
-webkit-transition: opacity 100ms ease;
-moz-transition: opacity 100ms ease;
-o-transition: opacity 100ms ease;
-ms-transition: opacity 100ms ease;
transition: opacity 100ms ease;
}
#instafeed a:hover .likes {
opacity:1;
}
非常感謝!應該更好地閱讀文檔,但是這對我幫助很大! – janlindso