Browse Source

Add background-image support with detection based on tagName

pull/32/head
Jean-Philippe Sirois 11 years ago committed by jpsirois
parent
commit
ddd1bfdd24
  1. 6
      src/echo.js

6
src/echo.js

@ -13,7 +13,11 @@ window.Echo = (function (window, document, undefined) {
for (var i = store.length; i--;) {
var self = store[i];
if (_inView(self)) {
self.src = self.getAttribute('data-echo');
if (self.tagName.toLowerCase() === 'img') {
self.src = self.getAttribute('data-echo');
} else {
self.style.backgroundImage = 'url(' + self.getAttribute('data-echo') + ')';
}
store.splice(i, 1);
}
}

Loading…
Cancel
Save