This is a migrated thread and some comments may be shown as answers.

Binding to backgroundImage broken in ie8

0 Answers 34 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 20 Sep 2012, 09:02 PM
On the html:

data-bind="style: {backgroundImage: imgSrc}"

On the observable:

imgSrc: function() { return 'url(' + this.get('filename') + ')'; }

In IE8:

this.element.style[a]=this.bindings.style[a].get() throws "Invalid argument."

this.bindings.style[a].get:

function(){
var a=this,b=a.source,c,d=a.path,f=b;
a.start();
if(a.observable) {
f=b.get(d);
while(f===undefined&&b)
b=b.parent(),b instanceof e&&(f=b.get(d));
typeof f=="function"&&(c=d.lastIndexOf("."),c>0&&(b=b.get(d.substring(0,c))),f=k(f,b),f=f(a.source)),b&&b

 

No answers yet. Maybe you can help?

Tags
MVVM
Asked by
Matt
Top achievements
Rank 1
Share this question
or