Browse Source

add support to div background

pull/41/head
blackout314 11 years ago
parent
commit
45b5a868f9
  1. 4
      src/echo.js

4
src/echo.js

@ -41,7 +41,11 @@ window.Echo = (function (global, document, undefined) {
for (var i = 0; i < length; i++) { for (var i = 0; i < length; i++) {
var self = store[i]; var self = store[i];
if (self && _inView(self)) { if (self && _inView(self)) {
if (self.tagName.toLowerCase() !== 'img') {
self.style.cssText += "background-image: url('" + self.getAttribute('data-echo') + "');";
} else {
self.src = self.getAttribute('data-echo'); self.src = self.getAttribute('data-echo');
}
callback(self); callback(self);
store.splice(i, 1); store.splice(i, 1);
length = store.length; length = store.length;

Loading…
Cancel
Save