jQuery mobile 图标

定位图标
请使用 data-iconpos 属性来规定位置
<a href="#link" data-role="button" data-icon="search" data-iconpos="top">上</a>
<a href="#link" data-role="button" data-icon="search" data-iconpos="right">右</a>
<a href="#link" data-role="button" data-icon="search" data-iconpos="bottom">下</a>
<a href="#link" data-role="button" data-icon="search" data-iconpos="left">左</a>

只显示图标
如果只需显示图标,请将 data-iconpos 设置为 "notext":

<a href="#link" data-role="button" data-icon="search" data-iconpos="notext">搜索</a>

 

jQuery mobile prop 用法

赋值时候

如果是<input type="checkbox" checked>这样的只有属性名就能生效的属性
推荐prop,即:$('input').prop('checked',true);
同时,false表示取消,即:$('input').prop('checked',false);
当然attr也行的:$('input').attr('checked','这里写什么都行的');
取消属性就是移除:$('input').removeAttr('checked');

取值的时候

如果是<input  id="input1" type="checkbox" checked><input  id="input2" type="checkbox">
推荐使用prop,即:
$('#input1').prop('checked'); //返回true
$('#input2').prop('checked'); //返回false
而使用attr,则:
$('#input1').attr('checked'); //返回checked
$('#input2').attr('checked'); //返回undefined

转载于:https://www.cnblogs.com/luoge/p/4368357.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值