使用Blueimp文件上载时,仅获取Blueimp库的奇数行



我有一个Blueimp的文件上传程序的自定义实现,除了一个主要缺陷外,一切都很顺利。库部分只对我的文件表中的每一行奇数行进行预览库。

请记住,由于这是自定义的,而且我只是讨厌模板引擎,所以我不使用模板布局。然而,创建的行非常相似。

上传多个文件后的示例表:

<table id="tblFileUpload" role="presentation">
<tbody class="files">
<tr>
<td class="td-thumb">
<canvas width="51" height="75" class="ui-widget-content ui-corner-all"></canvas>
<div class="preview-progress ui-progressbar ui-widget ui-widget-content ui-corner-all" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="100">
<div class="preview-progress-label">Complete!</div><div class="ui-progressbar-value ui-widget-header ui-corner-left ui-corner-right" style="width: 100%;"></div>
</div>
</td>
<td class="td-name">
<a href="http://68.67.73.249/jQueryFileUpload/server/php/files/Capture.PNG" target="_blank" data-gallery="data-gallery">Capture</a>
</td>
<td class="td-delete">
<button class="delete ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" data-confirmation-name="Capture.PNG" data-type="DELETE" data-url="http://68.67.73.249/jQueryFileUpload/server/php/?file=Capture.PNG" type="button" role="button" aria-disabled="false" title="Remove">
<span class="ui-button-icon-primary ui-icon ui-icon-close"></span>
<span class="ui-button-text">Remove</span>
</button>
</td>
</tr>
<tr>
<td class="td-thumb">
<canvas width="75" height="27" class="ui-widget-content ui-corner-all"></canvas>
<div class="preview-progress ui-progressbar ui-widget ui-widget-content ui-corner-all" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="100">
<div class="preview-progress-label">Complete!</div>
<div class="ui-progressbar-value ui-widget-header ui-corner-left ui-corner-right" style="width: 100%;"></div>
</div>
</td>
<td class="td-name"><a href="http://68.67.73.249/jQueryFileUpload/server/php/files/iamnew01.jpg" target="_blank" data-gallery="data-gallery">iamnew01</a>
</td>
<td class="td-delete">
<button class="delete ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" data-confirmation-name="iamnew01.jpg" data-type="DELETE" data-url="http://68.67.73.249/jQueryFileUpload/server/php/?file=iamnew01.jpg" type="button" role="button" aria-disabled="false" title="Remove">
<span class="ui-button-icon-primary ui-icon ui-icon-close"></span>
<span class="ui-button-text">Remove</span>
</button>
</td>
</tr>
<tr>
...

可能还值得注意的是,我一直在挑选库代码本身的一部分,它看起来也很相似,但与Blueimp的库插件不完全相同。我注意到,最后一个函数对我的变量a-I产生的结果与测试页面上的结果大不相同。我还得到以下错误:

GET http://[ip]/jQueryFileUpload/ig/play-pause.svg 404(未找到)

Blueimp对Gallery最后一个函数的测试返回示例

a function (e,t){return new x.fn.init(e,t,r)} jquery.blueimp-gallery.min.js:776
b function b(a, c) {
return a && a.length && void 0 !== document.body.style.maxHeight ? this && this.options === b.prototype.options ? (this.list = a, this.num = a.length, this.initOptions(c), this.initialize(), void 0) : new b(a, c) : null
} jquery.blueimp-gallery.min.js:777
c 
x.Event {originalEvent: MouseEvent, type: "click", isDefaultPrevented: function, timeStamp: 1389982738769, jQuery110202015542311128229: true…}
jquery.blueimp-gallery.min.js:778
d  jquery.blueimp-gallery.min.js:779
e 
[jquery: "1.10.2", constructor: function, init: function, selector: "", toArray: function…]
jquery.blueimp-gallery.min.js:780
f 
[div#blueimp-gallery.blueimp-gallery.blueimp-gallery-controls, context: document, selector: "#blueimp-gallery", jquery: "1.10.2", constructor: function, init: function…]
jquery.blueimp-gallery.min.js:781
g 
Object {onopen: function, onopened: function, onslide: function, onslideend: function, onslidecomplete: function…}
jquery.blueimp-gallery.min.js:782
h 
Object {filter: ":even", container: div#blueimp-gallery.blueimp-gallery.blueimp-gallery-controls, index: a, event: x.Event, onopen: function…}
jquery.blueimp-gallery.min.js:783
i 
[a, a, a, a, a, a, a, a, prevObject: x.fn.x.init[1], context: document, selector: "[data-gallery=""]", jquery: "1...

我的

a function (e,t){return new b.fn.init(e,t,r)} jquery.blueimp-gallery.min.js:776
b function b(a, c) {
return a && a.length && void 0 !== document.body.style.maxHeight ? this && this.options === b.prototype.options ? (this.list = a, this.num = a.length, this.initOptions(c), this.initialize(), void 0) : new b(a, c) : null
} jquery.blueimp-gallery.min.js:777
c 
b.Event {originalEvent: MouseEvent, type: "click", isDefaultPrevented: function, timeStamp: 1389982647710, jQuery19106168011745903641: true…}
jquery.blueimp-gallery.min.js:778
d  jquery.blueimp-gallery.min.js:779
e 
[jquery: "1.9.1", constructor: function, init: function, selector: "", size: function…]
jquery.blueimp-gallery.min.js:780
f 
[div#blueimp-gallery.blueimp-gallery.blueimp-gallery-controls, context: document, selector: "#blueimp-gallery", jquery: "1.9.1", constructor: function, init: function…]
jquery.blueimp-gallery.min.js:781
g 
Object {onopen: function, onopened: function, onslide: function, onslideend: function, onslidecomplete: function…}
jquery.blueimp-gallery.min.js:782
h 
Object {filter: ":even", container: div#blueimp-gallery.blueimp-gallery.blueimp-gallery-controls, index: a, event: b.Event, onopen: function…}
jquery.blueimp-gallery.min.js:783
i 
[a, a, a, a, prevObject: b.fn.b.init[1], context: document, selector: "[data-gallery=""]", jquery: "1...

熟悉这两个插件的人有什么想法吗?为什么我极其相似的布局不会产生完全相同的Gallery/Slideshow?

检查id blueimp厨房的html是否有如下内容:data filter=":even">

最新更新