Blind 效果可以与show/hide/toggle一起使用。这会将元素隐藏起来,或者通过将其隐藏而显示出来。
selector.hide|show|toggle( "blind", {arguments}, speed );
这是所有参数的描述-
direction - 效果的方向。可以是"vertical(垂直)"或"horizontal(水平)"。默认为垂直。
mode - 效果的模式。可以是"show"或"hide"。默认值为hide。
以下是一个简单的示例,简单说明了此效果的用法-
链接:https://www.learnfk.comhttps://www.learnfk.com/jquery/effect-blind.html
来源:LearnFk无涯教程网
<html> <head> <title>The jQuery Example</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"> </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"> </script> <script type="text/javascript" language="javascript"> $(document).ready(function() { $("#hide").click(function(){ $(".target").hide( "blind", {direction: "horizontal"}, 1000 ); }); $("#show").click(function(){ $(".target").show( "blind", {direction: "horizontal"}, 1000 ); }); }); </script> <style> p {background-color:#bca; width:200px; border:1px solid green;} </style> </head> <body> <p>Click on any of the buttons</p> <button id="hide"> Hide </button> <button id="show"> Show</button> <div class="target"> <img src="../images/jquery.jpg" alt="jQuery" /> </div> </body> </html>
这将产生以下输出-
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)