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"> | |
jQuery('document').ready(function($) { | |
// Handler for .ready() called. | |
}); | |
</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
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> | |
<link type="text/css" rel="stylesheet" media="all" href="http://domain.com/css/style.css" /> |
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
// variable to hold request | |
var request; | |
// bind to the submit event of our form | |
$("#foo").submit(function(event){ | |
// abort any pending request | |
if (request) { | |
request.abort(); | |
} | |
// setup some local variables | |
var $form = $(this); |
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); |
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
$('#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
//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
<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
//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"); |