I already read the other questions about that topic, but they've never really been solved.
I need to set the thumbnail of a listview centred.
Those Thumbnails have a maximal heigt, but some of my Icons are smaller than the maximal height. Setting a fixed padding to the thumbnail doesn't work for different thumbnail sizes.
Small Icon:
Larger Icon:
My list-items:
<%
boxFolder.each(function(box){
name = box.get("name");
fullPath = box.get("fullPath");
type = box.get("type");
%>
<li data-theme="c">
<%if(type == "dir"){ %>
<a data-transition="slide" class="folderSelectedButton" id=<%=fullPath%>>
<img src="images/FolderDark.png">
<h3><%=name%></h3>
<p>Folder</p>
</a>
<%}else if(type == "jpg"){%>
<a data-transition="slide" id=<%=fullPath%>>
<img src=<%=fullPath%>>
<h3><%=name%></h3>
<p>Picture</p>
</a>
<%}else{%>
<a data-transition="slide" id=<%=fullPath%>>
<img src="images/FolderDark.png">
<h3><%=name%></h3>
<p>Unknown</p>
</a>
<%}%>
</li>
<%
})
%>
Edit: The result now looks:
I added this to ezankers solution:
.imgListThumb {
max-width: 80px;
max-heigth: 80px;
}
<img class="imgListThumb" src=<%=fullPath%>>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…