jquery基本用法二
2016-07-26 18:48
513 查看
jquery的toggle用法,单击li变化不同的li的风格
<script>
$(function () {
$('li').toggle(
function ()
{
$(this).css({"ist-style-type":"disc","color":"red"});
},
function ()
{
$(this).css({"ist-style-type":"square","color":"blue"});
},
function()
{
$(this).css({"ist-style-type":"none","color":""});
}
)
});
</script>
<body>
<div>
<ul>
<li style="cursor: pointer">click me</li>
</ul>
</div>
</body>
<script>
$(function () {
$('li').toggle(
function ()
{
$(this).css({"ist-style-type":"disc","color":"red"});
},
function ()
{
$(this).css({"ist-style-type":"square","color":"blue"});
},
function()
{
$(this).css({"ist-style-type":"none","color":""});
}
)
});
</script>
<body>
<div>
<ul>
<li style="cursor: pointer">click me</li>
</ul>
</div>
</body>
相关文章推荐
- Jquery操作大全
- jquery基本用法一
- jQuery 遍历json数组的实现代码
- jquery源码中入口部分解析
- jQuery.nivo.slider.js 幻灯片图片切换
- php+ajax+jquery实现分页
- jquery - ajax - 400 415错误
- springmvc jquery json ajax
- jquery常用表单&DOM操作方法
- 简单的tab切换(jquery)
- jquery ligerui下拉框赋值问题
- jquery--获取链接参数
- 如何判断jquery选择器选择结果为空
- jQuery DOM基础
- jquery调用jsonp接口
- jquery全选和反全选在第三次点击后无效的问题
- $.ajax的简单用法
- 《锋利的jQuery》学习笔记<1>
- 基于jQuery实现页面搜索功能
- jquery的学习笔记