[HTML/CSS]uploadify自定义按钮样式
概述
在项目中经常用到uploadify上传插件,但是FLASH按钮的外观往往跟我们网页的设计的主题色不太搭配。这时就需要对其样式进行修改。
样式文件是uploadify.css.
打开这个文件后,你会看见CSS设置的按钮样式。
1 .uploadify-button { 2 background-color: #505050; 3 background-image: linear-gradient(bottom, #505050 0%, #707070 100%); 4 background-image: -o-linear-gradient(bottom, #505050 0%, #707070 100%); 5 background-image: -moz-linear-gradient(bottom, #505050 0%, #707070 100%); 6 background-image: -webkit-linear-gradient(bottom, #505050 0%, #707070 100%); 7 background-image: -ms-linear-gradient(bottom, #505050 0%, #707070 100%); 8 background-image: -webkit-gradient( 9 linear, 10 left bottom, 11 left top, 12 color-stop(0, #505050), 13 color-stop(1, #707070) 14 ); 15 background-position: center top; 16 background-repeat: no-repeat; 17 -webkit-border-radius: 30px; 18 -moz-border-radius: 30px; 19 border-radius: 30px; 20 border: 2px solid #808080; 21 color: #FFF; 22 font: bold 12px Arial, Helvetica, sans-serif; 23 text-align: center; 24 text-shadow: 0 -1px 0 rgba(0,0,0,0.25); 25 width: 100%; 26 } 27 .uploadify:hover .uploadify-button { 28 background-color: #606060; 29 background-image: linear-gradient(top, #606060 0%, #808080 100%); 30 background-image: -o-linear-gradient(top, #606060 0%, #808080 100%); 31 background-image: -moz-linear-gradient(top, #606060 0%, #808080 100%); 32 background-image: -webkit-linear-gradient(top, #606060 0%, #808080 100%); 33 background-image: -ms-linear-gradient(top, #606060 0%, #808080 100%); 34 background-image: -webkit-gradient( 35 linear, 36 left bottom, 37 left top, 38 color-stop(0, #606060), 39 color-stop(1, #808080) 40 ); 41 background-position: center bottom; 42 }
用修改下面的代码替换上面的代码,用图片代替是最简单一种方式:
1 .uploadify-button { 2 background:url(upload.PNG); 3 } 4 .uploadify:hover .uploadify-button { 5 background:url(upload.PNG); 6 }
下面就是修改一下按钮上的文字了,默认的是"SELECT FILES",这是英文的,当然你可以通过uploadify的属性进行修改,为了跟主页面的文字保持一致,还是要修改成中文的。打开jquery.uploadify.js,搜索这个字符串你就会找到它的位置:
buttonText:"SELECT FILES",
这是在js文件中修改的,也可以在属性中对其重新设置值。把这里的字符串替换成你想要的就可以了。我是直接设置为空了,因为这个字符串在按钮上的显示位置还得去找怎么调整。
总结
遇到问题,解决问题,虽然经常用到第三方的插件,但是遇到问题了,不妨深入的研究一下,修改部分代码即可解决问题。
-
博客地址:http://www.cnblogs.com/wolf-sun/
博客版权:如果文中有不妥或者错误的地方还望高手的你指出,以免误人子弟。如果觉得本文对你有所帮助不如【推荐】一下!如果你有更好的建议,不如留言一起讨论,共同进步! 再次感谢您耐心的读完本篇文章。
分类:
[HTML/CSS]
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义