Jiangws's Blog

 
 
 
  • About

    夢を叶える為
 
Cool Javascript Find on this Page… March 29th, 2017

http://www.seabreezecomputers.com/tips/find.htm

Posted in JavaScript || Comments Off on Cool Javascript Find on this Page…
jQuery: fire click() before blur() event March 21st, 2017

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 …

Posted in JavaScript || Comments Off on jQuery: fire click() before blur() event
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. March 17th, 2017

https://github.com/RubaXa/Sortable

Posted in JavaScript || Comments Off on 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内容显示不全问题解决方法 October 10th, 2011

不少时候在页面中为了布局的需要,下拉列表<select>的宽度需要设成比较小的值,这时如果恰巧它包含的选择项<option>的内容比较长,那么超出select宽度的部分将会被截断,如果option显示的内容又比较重要,必须完整地展现出来,或者你是个完美主义者,那这就成了一个不大不小的问题了。

在IE7+、Firefox中,由于支持了<option>的title属性,我们可以想办法给option标记设置title属性(内容可以与显示的值相同或者不同)。如果是已经做好的页面,不想再做太多改动,可以用下面的脚本,自动遍历页面上的所有<select>,给所有的option加上与text相同的title。

function SetOptionTitle()
{
    var selects = document.getElementsByTagName(“select”);
    if (selects.length > 0)
    {
        for (var i = 0; i < selects.length; i++)
        {
            var options = selects[i].options;
            if (selects[i].options.length > 0)
            {
                for (var j = 0; j < 
Posted in JavaScript || Comments Off on 固定宽度下拉列表中option内容显示不全问题解决方法
About Jquery July 2nd, 2011

JQuery: Write less Do more…

Posted in JavaScript || Comments Off on About Jquery
ラジオボタンにはlabelタグのforが便利 August 10th, 2006

Zopeジャンキー日記 :ラジオボタンにはlabelタグのforが便利:

はてなブックマークの「注目エントリー」で、3ユーザと5ユーザの切替ボタンが、
ラベルと連動していないことに気づいた。

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>

のようにすれば、ラベル部分もクリックできるようになります。

私はこの切替ボタンをよく押すので、

Posted in JavaScript || Comments Off on ラジオボタンにはlabelタグのforが便利
AJAX Timeouts with Prototype March 28th, 2006

codejanitor » AJAX Timeouts with Prototype:

Posted in Ajax, JavaScript || Comments Off on AJAX Timeouts with Prototype
Dict lookup March 22nd, 2006

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 …

Posted in JavaScript || Comments Off on Dict lookup
Bookmarklet Tool Categories March 16th, 2006

Bookmarklets – Tool Categories:

Posted in JavaScript || Comments Off on Bookmarklet Tool Categories
Draggable Layer March 15th, 2006

CodeLifter.com – JavaScript Amazing Draggable Layer Script:

Posted in JavaScript || Comments Off on Draggable Layer