gpt4 book ai didi

asp.net - 将所有图像隐藏在 DIV 中,除了没有滚动条的图像

转载 作者:太空宇宙 更新时间:2023-11-04 05:16:16 25 4
gpt4 key购买 nike

我有一个 div 容器,我在其中显示多张图片,现在我只需要显示一张图片并隐藏其余图片。

那我该怎么做呢?

这是我的容器:

  <script type="text/javascript">
// Convert divs to queue widgets when the DOM is ready
$(function () {
$("#uploader").plupload({
// General settings
runtimes: 'gears,flash,silverlight,browserplus,html5',
url: 'Final.aspx',
max_file_size: '10mb',
max_file_count: 25,
chunk_size: '1mb',
unique_names: true,

// Resize images on clientside if we can
// resize: { width: 320, height: 240, quality: 90 },

// Specify what files to browse for
filters: [
{ title: "Image files", extensions: "jpg,gif,png" },
{ title: "Zip files", extensions: "zip" }
],

// thumbnails
thumb: { width: 100, height: 100, quality: 90 },

// Flash settings
flash_swf_url: 'js/plupload.flash.swf',

// Silverlight settings
silverlight_xap_url: 'js/plupload.silverlight.xap'
});


// Client side form validation
$('form').submit(function (e) {
var uploader = $('#uploader').plupload('getUploader');

// Files in queue upload them first
if (uploader.files.length > 0) {
// When all files are uploaded submit form
uploader.bind('StateChanged', function () {
if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
$('form')[0].submit();
}
});

uploader.start();
}
else
alert('You must at least upload one file.');

return false;
});
var uploader = $('#uploader').plupload('getUploader');
uploader.bind('FileUploaded', function (up, file, res) {

$('#showfilelist').append("<div id=" + file.id + " class='thumb'><a href='uploads/" + document.getElementById("currentDirectory").value + "/" + file.name + "' target='_blank' rel='gallery'><img src='uploads/" + document.getElementById("currentDirectory").value + "/" + file.name + "' width='50' height='50'/></a></div>");

});
});

最佳答案

可能是这样的:

$('#showfilelist div').hide();//隐藏所有附加的 div
$('#showfilelist div').eq(0).show();//显示第一个

关于asp.net - 将所有图像隐藏在 DIV 中,除了没有滚动条的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7957552/

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