diff --git a/lib/style.js b/lib/style.js index 34f3600..2588096 100644 --- a/lib/style.js +++ b/lib/style.js @@ -35,13 +35,13 @@ Style = (function() { var attr, image, imagePath, images, pixelRatio, relativeImagePath, styles, _i, _len; imagePath = options.imagePath, relativeImagePath = options.relativeImagePath, images = options.images, pixelRatio = options.pixelRatio; this.pixelRatio = pixelRatio || 1; - styles = [this.css(this.selector, [" background: url( '" + relativeImagePath + "' ) no-repeat"])]; + styles = [this.css(this.selector, [" background-image: url( '" + relativeImagePath + "' )"])]; for (_i = 0, _len = images.length; _i < _len; _i++) { image = images[_i]; attr = [" width: " + image.cssw + "px", " height: " + image.cssh + "px", " background-position: " + (-image.cssx) + "px " + (-image.cssy) + "px"]; image.style = this.cssStyle(attr); image.selector = this.resolveImageSelector(image.name, image.path); - styles.push(this.css([this.selector, image.selector].join('.'), attr)); + styles.push(this.css('.'+image.selector, attr)); } styles.push("") css = styles.join("\n"); @@ -54,7 +54,7 @@ Style = (function() { (-webkit-min-device-pixel-ratio: " + this.pixelRatio + "),\n \ (min-device-pixel-ratio: " + this.pixelRatio + ") {\n \ .sprite {\n \ - background: url( '" + options.relativeImagePath + "' ) no-repeat;\n \ + background-image: url( '" + options.relativeImagePath + "' ) ;\n \ -moz-background-size: " + spriteWidth + "px " + spriteHeight + "px;\n \ -ie-background-size: " + spriteWidth + "px " + spriteHeight + "px;\n \ -o-background-size: " + spriteWidth + "px " + spriteHeight + "px;\n \