RSS Feed!

貓上腦

我近期

Twitter Updates

    follow me on Twitter

    賣豆”卜”

    Posts Tagged ‘Java Script’

    在 Facebook Apps/Profile Tab 下的圖片按鈕

    Monday, May 31st, 2010

    紀錄在案用!

    如要在 Application/Profile Tab 中加入 Mouse Over 換圖, 可使用 CSS 將圖片替換。

    <style type=”text/css”>
    #btn1{width:109px; height:31px; display:block; float:left;background:url(http://domain.com/image1.jpg); }
    #btn1:hover{background:url(http://domain.com/image1.jpg);}
    </style>
    <a href=”#” id=”btn1″></a>
    原本想測試可否用 onmouseover 來解決, 不過總是不能成功.
    可能跟那個sandbox 過濾了 javascript 有關

    PNG 能在 Internet Explorer 6 透明的方法

    Monday, April 27th, 2009

    最近找到 PNG 在IE6 上能透明較便利的方法, 

    建基於 jQuery, 此方法需要使用 Javascript 和 CSS

     

    假設你有這一段code :

    <style>
    .element{background:url(/some/images/image.png)}
    </style>

    <div class=”elemet”></div>

     

    當執行 $(‘.element’).fixPNG() 之後,

    class=”element” 的元件的類別(class) 為 “element” 中的背景圖就會由 backgroundImage 改做 Microsoft 的 Filter,

    使 PNG 作結尾的圖片檔案能在InternetExplorer 6 上回覆應有的透明層

    要看原始碼可到….

    http://docs.jquery.com/Tutorials:PNG_Opacity_Fix_for_IE6

    Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin