jQtransForm下載地址
用法
1- 添加腳本包含在標題部分的網頁
. 代碼如下:
//required
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.jqtransform.min.js"></script>
2- 寫你的 form
. 代碼如下:
<form class="jqtransform">
<div class="rowElem">
<label for="name">Name: </label>
<input type="text" name="name" />
</div>
<div class="rowElem">
<input type="submit" value="send" />
<div>
</form>
3- 最後使用插件
After it, select the forms and call the jqTransform plugin. See some examples:
. 代碼如下:
<script type="text/javascript">
$(function() {
//find all form with class jqtransform and apply the plugin
$("form.jqtransform").jqTransform();
});
</script>
兼容性:ie 6+, safari 2+, firefox 2+
附:select如有js聯動效果,則不能美化。需要原有的select,如以下方法:
. 代碼如下:
<script language="javascript">
$(function(){
$('.rowElem').jqTransform({imgPath:'jqtransformplugin/img/'});
});
</script>
. 代碼如下:
<form action="" class="jqtransformdone" method="POST">
<div class="rowElem">
<label>標題</label>
<input type="text" name="inputtext"/>
</div>
<div class="NOrowElem">
<label>地區</label>
<select name="select1">
<option selected="selected" value="0">省</option>
<option value="1523">北京</option>
<option value="1524">陝西省</option>
</select>
<select name="select2" >
<option selected="selected" value="">市</option>
<option value="1525">北京市</option>
<option value="1526">西安市</option>
</select>
</div>
</form>