form表单美化插件之jqTransform

 

jqTransform

http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/

下载: download

用法

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>

 

 

posted @ 2012-07-04 14:28  cssfirefly  阅读(2448)  评论(4编辑  收藏  举报
foot