2011年5月16日 星期一

古老的琥珀

4.1考古新增玩具
使用後變這樣
是個BUFF(orz) 持續5分鐘,物品CD30分鐘

2011年5月11日 星期三

設定/取得/移除DOM物件的style屬性

有兩種方法...
方法1: 適用IE9及其他非IE瀏覽器
obj.style.setProperty("background-color", "green");
obj.style.getPropertyValue("background-color");
obj.style.removeProperty("background-color");

方法2: 適用IE系列
obj.style.setAttribute("backgroundColor", "green");
obj.style.getAttribute("backgroundColor");
obj.style.removeAttribute("backgroundColor");

加上判斷瀏覽器類別,就一次搞定了
<html>
<head> 
<script type="text/javascript"> 
    function testMethod() {
        var browser=navigator.userAgent;
        var myDiv=document.getElementById("myDiv");
        if(browser.search("MSIE")>-1){
            alert(myDiv.style.getAttribute("backgroundColor"));
            myDiv.style.removeAttribute("backgroundColor");
            myDiv.style.setAttribute("backgroundColor", "green");
            alert(myDiv.style.getAttribute("backgroundColor"));
        }else{
            alert(myDiv.style.getPropertyValue("background-color"));
            myDiv.style.removeProperty("background-color");
            myDiv.style.setProperty("background-color", "green");
            alert(myDiv.style.getPropertyValue("background-color"));
        }
    }
</script> 
</head> 
<body> 
<div id="myDiv" style="background-color: red; height: 50px; width: 50px"></div><br /> 
<input type="button" value="T E S T" onclick="testMethod()" /> 
</body> 
</html> 

參考資料:Style handling methods in JavaScript

2011年5月10日 星期二

羅技 M705 馬拉松滑鼠


舊的去了新的就來了

2011年3月29日 星期二

羅技 K340


好優惠,不買嗎?

2011年2月28日 星期一

幸運女神 2011 OAD Vol.1

嘖...再高一點阿.....

2011年2月23日 星期三

選狼還是選獅子

前幾天隔壁部門主管轉寄了這篇文章給大家看
據說是美國暢銷書的選文

2011年2月18日 星期五

Oracle OCI-22053 錯誤

早上測試的時候程式噴了個錯誤給我

沒看過的error,只好來去拜Google神

原來是Oracle裡算出的數字長度過長,回傳到DataTable時發生溢位
比如說 1/3=0.333333333.....

解決的方法就是在查詢時 TO_CHAR 或 ROUND 就好了

參考資料
http://www.dotblogs.com.tw/puma/archive/2009/05/23/8536.aspx


筆記一下~