From 01b883aa29483f5fa60404e161837104ac16aeb0 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 25 Apr 2012 14:49:00 +0200 Subject: [PATCH] Added jQuery < 1.4.3 compatibility Before 1.4.3 data() did not include HTML5 data-* attributes. Tested with jQuery 1.4.2 --- jquery.lazyload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.lazyload.js b/jquery.lazyload.js index a5f14faa..b70dd825 100644 --- a/jquery.lazyload.js +++ b/jquery.lazyload.js @@ -95,7 +95,7 @@ .bind("load", function() { $self .hide() - .attr("src", $self.data(settings.data_attribute)) + .attr("src", $self.data(settings.data_attribute) || $self.attr('data-' + settings.data_attribute)) [settings.effect](settings.effect_speed); self.loaded = true; @@ -110,7 +110,7 @@ settings.load.call(self, elements_left, settings); } }) - .attr("src", $self.data(settings.data_attribute)); + .attr("src", $self.data(settings.data_attribute) || $self.attr('data-' + settings.data_attribute)); } });