gpt4 book ai didi

css - 给图像固定高度宽度不显示完整图像

转载 作者:太空宇宙 更新时间:2023-11-04 09:07:52 24 4
gpt4 key购买 nike

我有图像 slider 。它从数据库中的表格中滑动图像。为了显示正确的 slider ,我为图像提供了固定的高度宽度,如下所示

 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css" media="screen">
.slides_container {
width: 1000px;
height: 475px;
}

.slides_container div {
width: 1000px;
height: 475px;
display: block;
}
#newslides .slidesjs-previous {
position: absolute;
top: 25%;
left: 2%;
z-index:999;
}
#newslides .slidesjs-next{
position: absolute;
top: 25%;
right: 2%;
z-index:999;
}

</style>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<div class="breadcrumb">
<a href="News.aspx">News</a> <span>&gt;</span> Photo Gallery
</div>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="container">
<div id="example">
<div id="newslides" >
<asp:Repeater ID="rptGallery" runat="server">
<ItemTemplate>
<div class="slides_container">
<div style="float: left; height: 27px; width: 1000px; font-size: 18px;">
<span style="float: left"><%# Eval("Title") %> </span>
<span style="float: right"><%# Eval("PhotoCredit") %> </span>
</div>
<img src='<%# Eval("FileURL") %>' width="1000" height="475" alt="Slide 1">
</div>

</ItemTemplate>
</asp:Repeater>

<a href="#" class="slidesjs-previous slidesjs-navigation" >
<img src="images/prevArrow.png" width="50" height="43" alt="Arrow Prev">
</a>
<a href="#" class="slidesjs-next slidesjs-navigation" >
<img src="images/nextArrow.png" width="50" height="43" alt="Arrow Next">
</a>

</div>


</div>
</div>

<script src="Scripts/jquery.slides.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {

$('#newslides').slidesjs({
width: 940,
height: 250,
navigation: {
active: false,
effect: "slide",

},
pagination: {
active: false,
// [boolean] Create pagination items.
// You cannot use your own pagination. Sorry.
effect: "fade"
// [string] Can be either "slide" or "fade".
},
play: {
active: true,
auto: true,
interval: 2000,
swap: true,
pauseOnHover: true,
restartDelay: 2500,

}
});
});
</script>

但是,由于该图像裁剪。它不会在 slider 中显示完整图像。对此有任何解决方案。提前致谢

最佳答案

您使用了错误的 slider 尺寸。

更新你的

    $('#newslides').slidesjs({
width: 940, // change width to 1000
height: 250, // change height to 475
....

关于css - 给图像固定高度宽度不显示完整图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42343736/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com