inputに類似したタグを表示するプラグイン jQuery Tag Suggestion
- Category :
- Javascript
…ここからが続き
Tag Suggestion ダウンロード先、使い方
head内
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1.3");</script>
<script type="text/javascript" src="js/tag.js"></script>
<script type="text/javascript">
$(function () {
$('#tags').tagSuggest({
tags: ["agile","ajax","apache","api","apml","applescript","architecture","auth","autocomplete","beautify","bug","bugs","C","canvas","cheatsheet","closure","Cocoa","code","codedump","comet","compiler","compression","compressor","Computer","crossdomain","csrf","css3","D","dashcode","debug","debugger","debugging","development","dom","ext","firebug","firefox","flash","flex","framework","functions","greasemonkey","hack","hacks","howto","html","html5","ie","iframe","iframes","innerhtml","input","Java","javascript","jquery","js","js2","keycodes","keypress","LAMP","language","languages","leak","leaks","livesearch","memory","memoryleak","minify","moo","mootools","namespace","nu","oauth","obfuscate","obfuscator","objective-c","onload","oop","opml","optimisation","optimised","optimization","pack","packer","performance","perl","php","plugin","plugins","programming","prototype","prototyping","rail","rails","regexp","replacehtml","reserved","rest","ruby","scripting","scroll","scrolling","sdk","snippet"]
});
});
</script>
XHTML
<input class="input" type="text" name="tags" value="" id="tags" />
CSS
span.tagMatches span {
padding: 2px;
margin-right: 5px;
background: #212121;
color: #FFF;
cursor: pointer;
}
head内で記述した$('#tags')のID名とinputに記述ID名を同じにします。
head内で"agile","ajax","apache".........となっている部分が input に入力した際に表示される項目なので、 "サンプル" こんな感じで "" で挟んでタグを記入していって下さい。




