Skip to content

Instantly share code, notes, and snippets.

@zakki
Created October 30, 2014 06:38
Show Gist options
  • Select an option

  • Save zakki/9bc02d9e9b04cc8f12ce to your computer and use it in GitHub Desktop.

Select an option

Save zakki/9bc02d9e9b04cc8f12ce to your computer and use it in GitHub Desktop.
holder.js with knockout.js
ko.bindingHandlers["holderJs"] = {
init: function (element, valueAccessor) {
var value = valueAccessor();
$(element).attr("data-src", ko.unwrap(value));
Holder.run({ images: element });
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment