Home  >  Article  >  Web Front-end  >  jquery中交替点击事件toggle方法的使用示例_jquery

jquery中交替点击事件toggle方法的使用示例_jquery

WBOY
WBOYOriginal
2016-05-16 17:10:24890browse
复制代码 代码如下:

$('#clickId‘).toggle(

function(){$('#divId').hide();},

function(){$('#divId').show();}

);

toggle方法中有两个参数,分别是要交替执行的事件。如果不传参默认是显示隐藏功能
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn