- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Fine Upload ( http://fineuploader.com/ ) 及其相应的 total progress bar .
这是我的 html:
<div id="totalProgress" class="qq-total-progress-bar-container-selector progress">
<div class="qq-total-progress-bar-selector progress-bar progress-bar-success progress-bar-striped active" role="progressbar"></div>
</div>
上传文件时总进度条工作正常,上传完成后隐藏。
但我也在使用验证
validation: {
allowedExtensions: ['jpeg', 'jpg', 'png'],
itemLimit: 5,
sizeLimit: 5000000
},
问题是验证失败后进度条仍然可见。例如,我测试上传 6 张图片(验证错误),进度条仍然可见。这可能是因为验证错误后,html div 未获取 css 类 qq-hide
:
.qq-hide {
display: none;
}
如果文件被拒绝但它不起作用,我已经测试将其添加到我的fineuploader 函数中:
.on("REJECTED", function() {
$('#totalProgress').addClass('qq-hide');
});
意外场景 1:验证通过
意外场景 2:验证失败
最佳答案
请注意以下事项 from the API :
In Fine Uploader UI, the total progress bar will be hidden once it reaches 100%, or once there are no longer any files in progress.
因此,如果您按如下方式定义总进度条(不带其他属性):
<!-- Total progress bar -->
<div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">
<div class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>
</div>
如果上传失败(例如由于验证错误),它将自动变得不可见。
请注意以下有关此行为的信息 ( from the owner of Fine Uploader ):
There should be no content inside the qq-total-progress-bar-container-selector other than the qq-total-progress-bar-selector element as the progress-bar element is intended to consume all of the space in the progress-bar-container.
If you want to add other text that is dependent on the visibility of the total progress bar, you'd need to rethink your design a bit, and perhaps observe the totalProgress event to show/hide that label in the DOM.
例如,您可以监视进度条本身,然后在进度 > 0% 时添加标签。这可以通过使用 progress events
来完成这样,您的标签仅在上传通过验证后才会添加。
我已经为您准备了一个可用的 jsFiddle,其中包含总进度条和单独进度条。你可以看到,如果 qq 总进度条 div 内没有其他内容
,现在它可以正常工作了:
关于javascript - 精细上传者: hide total progress bar (and label) upon validation fail,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29650214/
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我有这段代码,我想在另一张工作表中查找一些单元格,如果它们符合条件,则将相邻单元格添加到返回到调用单元格函数的总数中。 Function collectUtfall(A1 As String, Ax
我知道默认的“CTRL+B”Windows 命令可用于显示所有嵌套文件。 是否有显示所有嵌套文件夹的快捷方式? 最佳答案 我怀疑 Total Commander 中是否存在此功能。内置tree实用性对
关于我的问题SQL是, 我有一个表,用户可以在其中输入名为 time_report 的时间报告数据。每个 time_report 都输入一个服务代码,每个代码都有不同的含义,包括开始、停止、时间和总计
在 Total Commander 中搜索时如何忽略 .svn 文件夹? 最佳答案 要从搜索中排除某些文件或文件夹,请在“搜索字段:”中使用以下语法: 从搜索中排除 *.bak 和 *.old 文件
我将如何编写 css 来访问以下类“total total_plus hidden_elem”或“total total_plus”? 我有 class="total total_plus"和 c
我正在查看 powershellpro.com 上的一些代码示例,但不明白他为什么编写循环数组的示例代码: ...增量从零开始然后加一,直到它小于或等于数组的长度减一... for ($i=0; $i
做了一个虚拟数据: data dummy; input q1 q3 q4 q2 q6$ bu$ q5; cards; 1 2 3 5 sa an 3 2 4 3 6 sm sa 4 6 5 3 8 c
我想知道如何在 magento 1.7 的订单网格中添加以下两个额外的列 客户总订单数 客户在订单上花费的总金额 我已经设法添加了列,但我无法让它显示任何数据。我相信问题的关键在于函数 *_prepa
我正在使用 dataImportHandler 将数据从 Oracle 数据库导入 solr。尽管导入和索引编制成功,但由于未创建文档,我无法搜索。日志中也没有错误。这是我的配置文件片段。请帮忙。
项目 item_id title active = 1/0 items_categories_map item_id category_id 我需要得到结果 category_id items_tot
当我运行命令时: find / 2>/dev/null -user root -type f -mmin -1 -exec du -cb {} + | grep total | head -1 我得到
我不明白为什么有时,计划的总成本可能是一个非常小的数字,而查看计划的内部,我们会发现巨大的成本。 (确实查询很慢)。 有人可以解释我吗? 这是一个例子。 显然,成本高的部分来自主选择中的一个字段,该字
因此,脚本以初始值 $8.90 开始,其想法是根据所选选项添加额外费用,HTML 分为 3 个部分 1.check-boxes、2 .选择并3.输入(文本)。 每个部分都是独立工作的,我正在尝试找到一
我有一个小问题。我一直在网上寻找答案,但主要是针对未生成/添加的输入字段。 $(document).ready(function(){ /* --- ADD FIELD --- */ $('
js框架。我正在尝试将数据从发布请求保存到数据库 模型(文章.js): NEWSCHEMA('Article').make(function(schema) { schema.define('titl
我想要所有间隔的总和,但我写这段代码时出现错误:使用未分配的局部变量 total ? enter TimeSpan total; foreach (var grp in query) { Time
我得到了以下数据,我需要返回递归总数(在本例中为 60)。下面的代码返回TypeError: Cannot read property 'Symbol(Symbol.iterator)' of und
我的项目要插入几个小时,你花了多少时间。它适用于整数值,但现在我需要添加字符串值。像Sunday ="NotWorknig"这样的东西;星期一=“8”;星期二=“生病了”; function Tota
尝试让停止按钮在用户单击开始时提供数字的运行总数。停止按钮不会给出总数,也不会保存您单击它时开始给出的数字。 我在这里做错了什么? package com.egroegnosbig.dicerolle
我是一名优秀的程序员,十分优秀!