[HTML/CSS]uploadify自訂按鈕樣式

來源:互聯網
上載者:User

標籤:style   blog   color   os   io   ar   檔案   div   問題   

概述

在項目中經常用到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檔案中修改的,也可以在屬性中對其重新設定值。把這裡的字串替換成你想要的就可以了。我是直接設定為空白了,因為這個字串在按鈕上的顯示位置還得去找怎麼調整。總結

遇到問題,解決問題,雖然經常用到第三方的外掛程式,但是遇到問題了,不妨深入的研究一下,修改部分代碼即可解決問題。

[HTML/CSS]uploadify自訂按鈕樣式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.