Skip to content

Commit 22c02cf

Browse files
committed
Fix broken algo for background image checking in FF/IE
1 parent 8a47d55 commit 22c02cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/jquery.adaptive-backgrounds.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@
6666
};
6767

6868
var getCSSBackground = function(){
69-
return $this.css('background-image')
70-
.replace('url(','').replace(')','');
69+
var str = $this.css('background-image');
70+
var regex = /\(([^)]+)\)/;
71+
var match = regex.exec(str)[1].replace(/"/g, '')
72+
return match;
7173
};
7274

7375
/* Subscribe to our color-found event. */

0 commit comments

Comments
 (0)