Skip to content

Commit 8657e91

Browse files
authored
Avoid back button problem with Iframes in Firefox
Avoid the back button problem with Iframes in Firefox, which causes the need to double click to return to the previous page when Lazyload-xt has already loaded the iframe.
1 parent d8e620b commit 8657e91

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jquery.lazyloadxt.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@
215215
src = $isFunction(srcAttr) ? srcAttr($el) : el.getAttribute(srcAttr);
216216

217217
if (src) {
218-
el.src = src;
218+
if ( el.tagName === 'IFRAME' )
219+
el.contentWindow.location.replace( src );
220+
else
221+
el.src = src;
219222
}
220223

221224
removeNode = true;

0 commit comments

Comments
 (0)