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
//內部(同一頁) | |
onclick='$("#tabs").tabs( "select", "tabs-2" )' | |
//外部(不同頁) | |
http://www.cglandmark.net/demosite/?page_id=88#thethe-tabs-1-2 | |
//在網址的最後面,加上Tab的ID,例如#thethe-tabs-1-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
<input type="text" class="numbersOnly" value="" /> | |
//And: | |
jQuery('.numbersOnly').keyup(function () { | |
this.value = this.value.replace(/[^0-9\.]/g,''); | |
}); |
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
<script type="text/javascript"> | |
if (typeof jQuery != 'undefined') { | |
alert('jQuery working!'); | |
} else { | |
alert('no jQuery, too bad...'); | |
} | |
</script> |
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
//You can try: | |
$( "td").click( function(event) { | |
$("#divId").css( {position:"absolute", top:event.pageY, left: event.pageX}); | |
}); | |
//After additional question was asked in the comment: | |
$( "td").click( function(event) { | |
var div = $("#divId"); |
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
<a href='javascript:history.go(-1)'>Search Result</a> |
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
//text版 | |
$('#test').each(function(){ | |
var $this = $(this); | |
var t = $this.text(); | |
$this.html(t.replace('<','<').replace('>', '>')); | |
}); | |
//HTML版 | |
$('#test').each(function(){ | |
var $this = $(this); | |
var t = $this.html(); |
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
$('#date-picker').datepicker({ | |
dateFormat : 'yy-mm-dd' | |
}); |
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
$(".container .component").each(function() | |
{ | |
$(".container", this).each(function() { | |
if($(this).css('width') == 'auto') | |
{ | |
$(this).css('border', '1px solid #f00'); | |
} | |
}); | |
}); |
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
//In jQuery 1.8, this can be done as follows: | |
(function($){ | |
$.fn.disableSelection = function() { | |
return this | |
.attr('unselectable', 'on') | |
.css('user-select', 'none') | |
.on('selectstart', false); | |
}; | |
})(jQuery); |