brandonaaron / jquery-cssHooks

Collection of cssHooks that work with jQuery 1.4.3+
Other
478 stars 80 forks source link

Update gradients.js #40

Closed atotic closed 11 years ago

atotic commented 11 years ago

Bug: hook did not work on multiple gradients. Why: "".replace(str, ) only replaces first occurence Fix: Use regex as an argument to "".replace

This fixed multiple gradients for me.

Example bad css: $(document.body).css({ background: 'linear-gradient(135deg, #708090 22px, #d9ecff 22px, #d9ecff 24px, transparent 24px, transparent 67px, #d9ecff 67px, #d9ecff 69px, transparent 69px), linear-gradient(225deg, #708090 22px, #d9ecff 22px, #d9ecff 24px, transparent 24px, transparent 67px, #d9ecff 67px, #d9ecff 69px, transparent 69px) 0 64px'});