Javascript Gallery lightbox仅在IE11中首次单击时不插入图像
我有一个在除IE11(震惊!)之外的所有浏览器中都能正常工作的图库 主要问题是,在IE11中,当您第一次单击库项目时,它不会从数据属性中插入图像url。如果您随后要加载下一幅图像(使用lightbox导航或gallery缩略图),则img src将被更新,并且工作正常 我注意到的另一个问题仅在IE11中存在。Javascript Gallery lightbox仅在IE11中首次单击时不插入图像,javascript,jquery,html,css,internet-explorer,Javascript,Jquery,Html,Css,Internet Explorer,我有一个在除IE11(震惊!)之外的所有浏览器中都能正常工作的图库 主要问题是,在IE11中,当您第一次单击库项目时,它不会从数据属性中插入图像url。如果您随后要加载下一幅图像(使用lightbox导航或gallery缩略图),则img src将被更新,并且工作正常 我注意到的另一个问题仅在IE11中存在。画廊导航计数器导航圈也不会触发加载任何其他图像 我一直在四处寻找,发现IE11可能存在prepend等方面的问题,但我已经尝试改变这一点,以及我在网上看到的一些其他解决方案,但我无法让gal
画廊导航
计数器导航圈也不会触发加载任何其他图像
我一直在四处寻找,发现IE11可能存在prepend等方面的问题,但我已经尝试改变这一点,以及我在网上看到的一些其他解决方案,但我无法让gallery在IE11中正常工作
(函数(){
var galleryLightbox=document.querySelector(“.gallery lightbox”);
var galleryItems=document.querySelectorAll(“.gallery项”);
var closeButton=document.querySelector(“.gallery close”);
var nextButton=document.querySelector('.gallery next');
var-previousButton=document.querySelector(“.gallery-previous”);
var galleryItemIndex=0;
函数createGalleryNavigation(){
var navigationItemHtml=';
var navigation=document.querySelector(“.gallery navigation”);
对于(变量i=0;i
#图库相册{
宽度:100%;
边缘底部:87px;
}
.画廊灯箱{
显示:无;
位置:固定;
左:0;
排名:0;
宽度:100vw;
高度:100vh;
z指数:999999;
}
.图库内容{
宽度:100vw;
高度:100vh;
位置:固定;
左:0;
右:0;
排名:0;
底部:0;
背景色:rgba(0,0,0,0.8);
}
.室内画廊{
显示器:flex;
宽度:100%;
身高:100%;
对齐项目:居中;
证明内容:中心;
}
.画廊图片{
位置:相对位置;
利润率:0.10%;
显示:内联块;
}
.画廊图片{
最大高度:70vh;
最大宽度:100%;
}
.画廊图片顶部{
位置:相对位置;
}
.gallery导航包装器{
显示器:flex;
位置:相对位置;
}
.图库标题{
背景:白色;
宽度:100%;
填充:35px 50px 55px;
柔性生长:1;
宽度:0;
}
.图库标题p{
字体大小:12px;
线高:16px;
颜色:黑色;
保证金:0;
填充:0;
}
.画廊关闭{
宽度:40px;
高度:40px;
边界半径:100%;
背景色:rgba(255、255、255、0.8);
显示器:flex;
证明内容:中心;
对齐项目:居中;
位置:绝对位置;
顶部:20px;
右:20px;
边界:无;
大纲:0;
变换:旋转(0度);
过渡时间:0.3s;
过渡性质:全部;
光标:指针;
}
.画廊关闭:悬停,
.画廊关闭:活动,
.画廊关闭:聚焦{
大纲:0;
变换:旋转(360度);
背景色:rgba(255、255、255、1);
}
.画廊关闭:之后,
.画廊关闭:之前{
内容:'';
宽度:20px;
高度:2倍;
背景色:$monza;
位置:绝对位置;
}
.画廊关闭:之前{
变换:旋转(45度);
}
.画廊关闭:之后{
变换:旋转(-45度);
}
.多媒体资料控制{
宽度:42px;
高度:42px;
边界半径:100%;
背景色:rgb
Error: Object doesn't support property or method 'from'
// Production steps of ECMA-262, Edition 6, 22.1.2.1
if (!Array.from) {
Array.from = (function () {
var toStr = Object.prototype.toString;
var isCallable = function (fn) {
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
};
var toInteger = function (value) {
var number = Number(value);
if (isNaN(number)) { return 0; }
if (number === 0 || !isFinite(number)) { return number; }
return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
};
var maxSafeInteger = Math.pow(2, 53) - 1;
var toLength = function (value) {
var len = toInteger(value);
return Math.min(Math.max(len, 0), maxSafeInteger);
};
// The length property of the from method is 1.
return function from(arrayLike/*, mapFn, thisArg */) {
// 1. Let C be the this value.
var C = this;
// 2. Let items be ToObject(arrayLike).
var items = Object(arrayLike);
// 3. ReturnIfAbrupt(items).
if (arrayLike == null) {
throw new TypeError('Array.from requires an array-like object - not null or undefined');
}
// 4. If mapfn is undefined, then let mapping be false.
var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
var T;
if (typeof mapFn !== 'undefined') {
// 5. else
// 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
if (!isCallable(mapFn)) {
throw new TypeError('Array.from: when provided, the second argument must be a function');
}
// 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
if (arguments.length > 2) {
T = arguments[2];
}
}
// 10. Let lenValue be Get(items, "length").
// 11. Let len be ToLength(lenValue).
var len = toLength(items.length);
// 13. If IsConstructor(C) is true, then
// 13. a. Let A be the result of calling the [[Construct]] internal method
// of C with an argument list containing the single item len.
// 14. a. Else, Let A be ArrayCreate(len).
var A = isCallable(C) ? Object(new C(len)) : new Array(len);
// 16. Let k be 0.
var k = 0;
// 17. Repeat, while k < len… (also steps a - h)
var kValue;
while (k < len) {
kValue = items[k];
if (mapFn) {
A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
} else {
A[k] = kValue;
}
k += 1;
}
// 18. Let putStatus be Put(A, "length", len, true).
A.length = len;
// 20. Return A.
return A;
};
}());
}