<html>
<head>
目前分類:jQuery (71)
- Jun 01 Wed 2016 12:12
上傳前預覽
- May 06 Fri 2016 11:54
判別行動裝置
var uA = navigator.userAgent;
if (uA.match(/iPod/) || uA.match(/iPad/) || uA.match(/iPhone/) || uA.match(/Android/) || uA.match(/Windows Phone/)) {
- Mar 30 Wed 2016 10:41
[轉貼]上傳檔案前,JavaScript檢查檔案格式、大小
- Oct 26 Mon 2015 17:36
safari link double-touch issue
$(document).ready(function(){
$('a').on('click touchend',function(e){var el = $(this);var link = el.attr('href');
window.location = link;
});
});
- Sep 10 Thu 2015 16:05
javascript 手機驗證
var MobileReg = /^(09)[0-9]{8}$/;
(str.match(MobileReg)) ? true : false
- Sep 02 Wed 2015 10:27
jQuery 全形半形字數限制
function calculate(str,limit) {
- Aug 24 Mon 2015 15:55
jQuery Plugin
- Aug 24 Mon 2015 15:37
使用 ajax 注意事項
- Jun 18 Thu 2015 16:41
jquery scroll到指定物件
var url = window.location.href; if (url.indexOf("action=3") >= 0) { $('html, body').animate({ scrollTop: $('.3').offset().top }, 'fast'); } else { if (url.indexOf("action=2") >= 0) { $("body, html").animate({ scrollTop: $('.2').offset().top }, 'fast'); } }
- Jun 18 Thu 2015 15:46
jquery location.href reload page with hash
window.location.href +="#mypara"; location.reload();
- Jun 12 Fri 2015 14:22
bootstrap modal
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Open modal for @mdo</button> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat">Open modal for @fat</button> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap">Open modal for @getbootstrap</button> ...more buttons... <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="exampleModalLabel">New message</h4> </div> <div class="modal-body"> <form> <div class="form-group"> <label for="recipient-name" class="control-label">Recipient:</label> <input type="text" class="form-control" id="recipient-name"> </div> <div class="form-group"> <label for="message-text" class="control-label">Message:</label> <textarea class="form-control" id="message-text"></textarea> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Send message</button> </div> </div> </div> </div>
- Jun 09 Tue 2015 18:36
jQuery image responsive
$('.img_div').load(function () { var window_h = $(window).height(); var top = (window_h - $('.img_div').height()) / 2; top = top < 0 ? 0 : top; $('#popdiv').css({ top: top + 'px' }); }) $(window).resize(function () { var window_h = $(window).height(); var top = (window_h - $('.img_div').height()) / 2; top = top < 0 ? 0 : top; $('#popdiv').css({ top: top + 'px' }); }) .img_div{ max-width:90%; max-height:90%; }
- Jun 05 Fri 2015 10:18
jquery 改url參數
window.location.search = jQuery.query.set("rows",10);
var i= jQuery.query.get("rows");
http://plugins.jquery.com/query-object/
- Jun 01 Mon 2015 14:26
div文字垂直水平置中
- May 09 Sat 2015 21:01
jQuery 偵測滑鼠scroll down or up
var lastScrollTop =0;
$(window).scroll(
- May 09 Sat 2015 18:05
scrollDownPage
http://alvarotrigo.com/fullPage/#firstPage
http://www.thepetedesign.com/demos/onepage_scroll_demo.html
- Apr 30 Thu 2015 16:23
jQuery FB按鈕動畫隱藏
if($(this).css("margin-right") == "200px")
{
- Apr 23 Thu 2015 16:35
Templete參考
- Apr 23 Thu 2015 11:49
jQuery dataTable 排序 搜尋
$('#dataTables-example').dataTable({ order: [[0, 'desc']] }); $('#dataTables-example').dataTable() .columnFilter({ aoColumnDefs: [{ "bSortable": false, "aTargets": [0] }], sPlaceHolder: "head:before", aoColumns: [{ type: "select" }, { type: "text" }, { type: "select" }, { type: "select" }, { type: "select" }, null ] });
- Apr 22 Wed 2015 18:27
jQuery 捲軸跑到最上面
$(window).scroll(function () { if ($(this).scrollTop() > 300) { $('#goTop').fadeIn("fast"); } else { $('#goTop').stop().fadeOut("fast"); } });