Skip to content

Instantly share code, notes, and snippets.

@nenjiru
nenjiru / uniqueRandom.js
Last active September 23, 2015 22:08
重複しない乱数
/**
* Random numbers that do not overlap.
* @param {Number} length 生成数
* @param {Number} max 閾値
* @return {Array}
*/
function uniqueRandom(length, max)
{
var random, result = [];
@nenjiru
nenjiru / toObject.js
Last active September 23, 2015 22:08
クエリーストリングをハッシュに変換
/**
* Query string convert to hash.
*
* @param {String} string ?を含んだ文字列
* @return {Object}
*
* @example
* toObject("index.html?width=500&height=auto");
* {width:500, height:auto}
*/
@nenjiru
nenjiru / ellipsis.js
Created October 13, 2010 06:10
表示文字数を指定してトリミング
/**
* Trimming strings.
*
* @param {String} string 対象文字列
* @param {Number} size 全角での長さ
* @param {String} ellipsis 省略文字(初期値 "...")
* @return {String} 整形文字列
*
* @example
* ellipsis("表示したい全角文字数を指定", 10);
@nenjiru
nenjiru / jquery.rollover.js
Created October 15, 2010 03:06
ロールオーバー jQuery Plugin
////////////////////////////////////////////////////////////////////////////////
// Rollover - jQuery Plugin
// 識別子.拡張子で読込めた画像をロールオーバープラグイン
//
// Copyright 2010, Minoru Nakanow
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
//
// Usage:
// $("img").rollover();
@nenjiru
nenjiru / jquery.toObject.js
Created October 15, 2010 03:07
クエリーストリングをハッシュに変換 jQuery Plugin
////////////////////////////////////////////////////////////////////////////////
// Query string convert to hash - jQuery Plugin
// クエリーストリングをハッシュに変換
//
// Copyright 2010, Minoru Nakanow
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
//
// Usage:
// $.toObject("index.html?width=500&height=auto");
@nenjiru
nenjiru / jquery.stripeTable.js
Created October 15, 2010 03:08
ストライプテーブル jQuery Plugin
////////////////////////////////////////////////////////////////////////////////
// Add a classname to the alternate - jQuery Plugin
// 交互にクラス名を付与してストライプなテーブルを作成
//
// Copyright 2010, Minoru Nakanow
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
//
// Usage:
// $("table").stripeTable();
@nenjiru
nenjiru / jquery.newWindow.js
Created October 15, 2010 03:11
別窓展開 jQuery plugin
////////////////////////////////////////////////////////////////////////////////
// Open new window - jQuery plugin
// target属性で指定する別窓展開プラグイン
//
// Copyright 2010, Minoru Nakanow
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
//
// Usage:
// <a href="example.html?width=full&height=full" target="new">全画面展開</a></p>
@nenjiru
nenjiru / jquery.smartScroll.js
Created October 15, 2010 03:13
スムーズスクロール jQuery Plugin
////////////////////////////////////////////////////////////////////////////////
// Smart scroll - jQuery Plugin
// ページをまたいで作動するスムーズスクロール
//
// Copyright 2010, Minoru Nakanow
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
//
// Usage:
// $("a[href^='#']:not([target])").pageScroll();
@nenjiru
nenjiru / dateset.js
Created October 15, 2010 03:32
日付処理
////////////////////////////////////////////////////////////////////////////////
// Dateset
// 指定期間の日付/曜日の出力など
// Copyright 2010, Minoru Nakanou
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
////////////////////////////////////////////////////////////////////////////////
(function() {
/**
* @private
@nenjiru
nenjiru / example.html
Created October 15, 2010 13:55
Flickrのフォトセットを自動再生 jQuery Plugin
<html lang="ja">
<head>
<meta charset="utf-8">
<title>jquery.getphotos.js</title>
<style type="text/css">
* {
border: none;
list-style: none;
}