Posts Categorized: JavaScript
jQuery: fire click() before blur() event
Solution 1
Listen to mousedown
instead of click
.
The mousedown
and blur
events occur one after another when you press the mouse button, but click
only occurs when you release it.
Solution 2
You can preventDefault()
in mousedown
to …
Sortable — is a JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery. Supports Meteor, AngularJS, React, Polymer, Knockout and any CSS library, e.g. Bootstrap.
固定宽度下拉列表中option内容显示不全问题解决方法
不少时候在页面中为了布局的需要,下拉列表<select>的宽度需要设成比较小的值,这时如果恰巧它包含的选择项<option>的内容比较长,那么超出select宽度的部分将会被截断,如果option显示的内容又比较重要,必须完整地展现出来,或者你是个完美主义者,那这就成了一个不大不小的问题了。
在IE7+、Firefox中,由于支持了<option>的title属性,我们可以想办法给option标记设置title属性(内容可以与显示的值相同或者不同)。如果是已经做好的页面,不想再做太多改动,可以用下面的脚本,自动遍历页面上的所有<select>,给所有的option加上与text相同的title。



















About Jquery
JQuery: Write less Do more…
ラジオボタンにはlabelタグのforが便利
Zopeジャンキー日記 :ラジオボタンにはlabelタグのforが便利:
ラベルと連動していないことに気づいた。
HTMLソースでいうと、いま
<input value=”3″ name=”threshold” type=”radio”>
3users
<input value=”5″ name=”threshold” type=”radio”>
5users
のようになっていますが(ちょっと簡略化しています)、
<input value=”3″ name=”threshold” type=”radio” id=”button1″ />
<label for=”button1″>3users</label>
<input value=”5″ name=”threshold” type=”radio” id=”button2″ />
<label for=”button2″>5users</label>
のようにすれば、ラベル部分もクリックできるようになります。
私はこの切替ボタンをよく押すので、
AJAX Timeouts with Prototype
codejanitor » AJAX Timeouts with Prototype:
…
Dict lookup
Dict lookup
This MS IE 4+ add-on lets you easily look up words using the dict.org server. Just highlight the word, right click, and chose dict. A new window will open with the dict.org page and the …
Bookmarklet Tool Categories
Bookmarklets – Tool Categories:
…
Draggable Layer
CodeLifter.com – JavaScript Amazing Draggable Layer Script:
…