This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input { | |
| position: absolute; | |
| left: 10px; | |
| top: 35px; | |
| width: 280px; | |
| height: 30px; | |
| padding: 0; | |
| margin: 0; | |
| border: 0; | |
| background-color: transparent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(".someone>input").keyup(function(event){ | |
| if(event.keyCode == 13){ | |
| $("#someone").click(); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://stackoverflow.com/questions/7184573/pick-up-the-android-version-in-the-browser-by-javascript | |
| function getAndroidVersion(ua) { | |
| ua = (ua || navigator.userAgent).toLowerCase(); | |
| var match = ua.match(/android\s([0-9\.]*)/); | |
| return match ? match[1] : false; | |
| }; | |
| getAndroidVersion(); //"4.2.1" | |
| parseInt(getAndroidVersion(), 10); //4 | |
| parseFloat(getAndroidVersion()); //4.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Safari and UIWebView give mostly the same User Agent, but UIWebView is missing Version/* and Safari/*. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function addZero(str: string, length: number): string { | |
| return new Array(length - str.length + 1).join("0") + str; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function identify(check){ | |
| var type = {a:10, b:11, c:12, d:13, e:14, f:15, g:16, h:17, j:18, k:19, l:20, m:21, n:22, p:23, q:24, r:25, s:26, t:27, u:28, v:29, w:32, x:30, y:31, z:33, i:34, o:35 }; | |
| var val = type[check[0].toLowerCase()] + check.substring(1); | |
| var ranks = [1,9,8,7,6,5,4,3,2,1]; | |
| var checknum = 0; | |
| for(var i = 0 ; i < ranks.length;++i){ | |
| checknum += parseInt(val[i],10) * ranks[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| checkForm(): boolean { | |
| var msg: string = ""; | |
| if ($("#form_name").val().length < 1) { | |
| msg += "請輸入中文姓名\n"; | |
| }else{ | |
| var chineseCount: number = $("#form_name").val().split(/[\u4e00-\u9fa5]/).length - 1; | |
| trace("chineseCount : " + chineseCount); | |
| trace("姓名.length : " + $("#form_name").val().length); | |
| if($("#form_name").val().length != chineseCount){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://css-tricks.com/snippets/css/momentum-scrolling-on-ios-overflow-elements/ | |
| .module { | |
| width: 300px; | |
| height: 200px; | |
| overflow-y: scroll; /* has to be scroll, not auto */ | |
| -webkit-overflow-scrolling: touch; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var str = "test 測試"; | |
| var chineseCount = str.split(/[\u4e00-\u9fa5]/).length - 1; | |
| console.log(chineseCount); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.easily.utils | |
| { | |
| import flash.display.BitmapData; | |
| import flash.geom.Matrix; | |
| public class BitmapDataUtils | |
| { | |
| //水平翻轉一個位圖 | |
| public static function flipHorizontal(bmpData:BitmapData, transparent:Boolean = true, fillColor:uint = 0):BitmapData | |
| { |