顯示具有 Html 標籤的文章。 顯示所有文章
顯示具有 Html 標籤的文章。 顯示所有文章

2017年1月16日 星期一

限制Html Input只能輸入數字


<input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57'>
</input>
參考網址

2016年1月14日 星期四

於手機及平板上實現拖曳功能

於手機及平板上實現拖曳功能



Using Touch Punch is as easy as 1, 2…

Just follow these simple steps to enable touch events in your jQuery UI app:
  1. Include jQuery and jQuery UI on your page.
    <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
  2. Include Touch Punch after jQuery UI and before its first use.
    Please note that if you are using jQuery UI's components, Touch Punch must be included after jquery.ui.mouse.js, as Touch Punch modifies its behavior.
    <script src="jquery.ui.touch-punch.min.js"></script>
  3. There is no 3. Just use jQuery UI as expected and watch it work at the touch of a finger.
    <script>$('#widget').draggable();</script>


參考網頁: http://touchpunch.furf.com/

Html 網頁閃爍字

CSS設定閃爍:
               A.SaveWarrning {
display:none;
color:red;
    animation-duration: 0.5s;
    animation-name: blink;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
    font-weight:bold;
}
@keyframes blink {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

Html:
           <A class="SaveWarrning">修改後請存檔!!!</A> 

Jquery:
           $("A.SaveWarrning").show();

           $("A.SaveWarrning").hide();

2015年11月11日 星期三

取得網頁上表格Table內容[JQuery]

使用JQuery取得網頁內Table的資料

function RunJob(){
    var TableData = getTableData($('#GridName'));
}
             
function getTableData(table) {
    var data = [];
    table.find('tr').each(function (rowIndex, r) {
        var cols = [];
        $(this).find('th,td').each(function (colIndex, c) {
            cols.push(c.textContent);
        });
        data.push(cols);
    });
    return data;
}


參考網頁