http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/
2009年1月24日 星期六
2009年1月19日 星期一
2009年1月10日 星期六
2009年1月7日 星期三
Get Controller's offset values using JQuery
var left = $(obj).offset().left;
var top = $(obj).offset().top;
http://docs.jquery.com/CSS/offset
Drag and Sort
JQueryの公式サイトはUIに関していろんなpluginも提供する。
たどえばマウスについてのエフェクト:Drag, Drop, Sortなど。
書類のサイトはこちら http://docs.jquery.com/UI
ダウンロードはこちら http://ui.jquery.com/download
ダウンロードのサイトはとてもやさしくて いろんな功能に関して人々のほうしいものによって
ライブラリを添ってダウンロードすることができる。
ここで sortableを紹介するわ~
<script>
$(document).ready(function(){
$('#imgList').sortable({stop: idrop, cursor: 'move'});
});
</script>
.
.
<ul id="myList">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
このsortableライブラリのいいところは serializeすることも用意してくれる。
<script>
function serialize(){
alert($('#imgList').sortable('serialize'));
}
</script>
<script>
function idrop(){
var str = '';
var result = $('#imgList').sortable('toArray');
for(var i in result){
str += result[i];
if( i < result.length-1 ) str += ',';
}
document.getElementById('sorted').value = str;
//alert(str);
}
</script>
最後に物件をdragしたりdropしたりした後、stopのpropertyを指定すれば、順番はどうやって変わられたのは分かる。
$('#imgList').sortable({stop: idrop, cursor: 'move'});
こういうpluginはすばらしいと思う、プログラマーにとって使いやすいよ~
2009年1月6日 星期二
Focus the last checkbox at the first td of the last tr of the specific table
$('#newstable tr:last td:first input').focus();
2009年1月5日 星期一
Get CheckBox values with ASP Upload
使用了asp upload即無法使用request.form等方法, 必須使用upload.form代替
但是aspupload.form卻沒有跟request.form完全依樣
在於checkbox, select multiple的帶有多值的html control
request.form -> request.form("chk")可以獲得"A, B, C"型式的value
upload.form -> 把同一個name的不同control都是分別獨立的item value
upload.form("chk") = "A"
upload.form("chk") = "B"
upload.form("chk") = "C"
必須使用
明明vbscript 是none case-sensitive, 這邊卻要用LCASE才能比對成功!!
但是aspupload.form卻沒有跟request.form完全依樣
在於checkbox, select multiple的帶有多值的html control
request.form -> request.form("chk")可以獲得"A, B, C"型式的value
upload.form -> 把同一個name的不同control都是分別獨立的item value
upload.form("chk") = "A"
upload.form("chk") = "B"
upload.form("chk") = "C"
必須使用
for each item in upload.form
if LCASE(item.name) = "chk" then
'get value
item.value
end if
next
一個非常重要的重點明明vbscript 是none case-sensitive, 這邊卻要用LCASE才能比對成功!!
訂閱:
文章 (Atom)