如何将 Jquery 星级评级的星级图像从 fyneworks 更改为其他图像
我使用这个插件: http://www.fyneworks.com/jquery/star- rating
它包括一个star.gif(实际上包含三种不同颜色的星星),并且它只在包含的css文件中引用此gif一次:
div.star-rating,div.star-rating a{background:url(star.gif) no-repeat 0 0px}
我不想再使用star.gif,而是使用我自己的png图像格式。我怎样才能做到这一点?
我想会有三个选项:
创建我自己的 myGif.gif 并在 jquery- rating CSS 中引用它(我不想要,因为我想使用我的 .png-Images 并且我不太理解 gif 并且不了解它)知道如何创建一个包含多个图像的图像)
将 CSS 文件更改为引用我的 .png 图像(这里的问题是 gif 包含三种不同颜色的星星,但只有一个 png包含单个图像,因此星星的颜色不再改变)
也许更改 Jquery-Rating Javascript 文件,以便它自动包含我的 png?
你会推荐什么?以及如何做呢?
Im using this plugin: http://www.fyneworks.com/jquery/star-rating
It includes a star.gif (which actually contains the star in three different colors) and it only references this gif within the included css-file once:
div.star-rating,div.star-rating a{background:url(star.gif) no-repeat 0 0px}
I dont want to use the star.gif anymore but instead use my own images in png Format. How can I do that?
I guess there would be three options:
Create my own myGif.gif and reference it in the jquery-rating CSS (which I dont want, because I want to use my .png-Images and I dont really understand gif and dont know how to create one which includes several images)
Change the CSS-File to it references my .png-Images (the problem here would be that the gif contains the star in three different colors, but a png only contains a single image, so the color of the star wont change anymore)
Maybe change the Jquery-Rating Javascript Files so that it includes my pngs automatically?
What would you recommend? And how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这看起来很基本。只需更改 css 文件以指向您的图像即可。这确实是唯一有意义的解决方案。
This seems pretty basic. Just change the css file to point to your images. It's really the only solution that makes sense.
您所要做的就是更改插件创建的 DIV 和 As 的背景图像,如下所示:
这是我们制作的示例:
http://jsfiddle.net/tLuqJ/1/
这是您可以用作的原始图像制作自己的颜色的基础:
http://jquery-star- rating-plugin.googlecode.com /svn/trunk/star.gif
All you have to do is change the background image of the DIVs and As created by the plugin, like this:
Here is an example we made:
http://jsfiddle.net/tLuqJ/1/
And here is the original image you can use as the basis to make your own colours:
http://jquery-star-rating-plugin.googlecode.com/svn/trunk/star.gif
在您自己的 css 文件中覆盖它:
Override it in your own css file: