首页 前端知识 无涯教程-jQuery - Clip方法函数

无涯教程-jQuery - Clip方法函数

2024-04-01 10:04:42 前端知识 前端哥 108 157 我要收藏

剪辑效果可与show/hide/toggle一起使用。这将在垂直或水平方向上将元素剪裁为ON或OFF。

Clip - 语法

selector.hide|show|toggle( "clip", {arguments}, speed );

下面是对所有参数-的描述

  • direction - 方向。可以是“垂直(vertical)”或“水平(horizontal)”。默认为垂直(vertical)。

  • mode       - 效果的模式。可以是“显示(show)”或“隐藏(hide)”。默认为hide。

Clip - 示例

下面是一个简单的示例,一个简单的示例显示了此效果-的用法

<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( "clip", {direction: "horizontal"}, 1000 );
            });

            $("#show").click(function(){
               $(".target").show( "clip", {direction: "vertical"}, 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>

这将产生以下输出-

jQuery 中的 Clip方法函数 - 无涯教程网无涯教程网提供剪辑效果可与show/hide/toggle 一起使用。这将在垂直或水平方向上将元素剪裁为ON或OFF...https://www.learnfk.com/jquery/effect-clip.html

转载请注明出处或者链接地址:https://www.qianduange.cn//article/4392.html
标签
评论
发布的文章

爱心

2024-06-27 17:06:24

表白代码

2024-06-27 16:06:42

html5 css3 前端基础认识。

2024-06-26 23:06:18

CFT Show 信息收集篇

2024-06-26 23:06:28

html插入视频的方法

2024-06-20 00:06:46

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!