博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
slideup_jQuery slideUp,slideDown,slideToggle
阅读量:2533 次
发布时间:2019-05-11

本文共 8642 字,大约阅读时间需要 28 分钟。

slideup

jQuery provides three useful sliding effect methods – slideUp, slideDown and slideToggle. We can use these methods to with sliding effect.

jQuery提供了三种有用的滑动效果方法: slideUpslideDownslideToggle 。 我们可以使用这些方法来具有滑动效果 。

jQuery幻灯片 (jQuery slide)

We will look at different jQuery sliding methods with examples.

我们将通过示例介绍不同的jQuery滑动方法。

  1. : jQuery slideDown() method is used to show the hidden HTML element where it looks like the content is getting shown by sliding down.

    :jQuery slideDown()方法用于显示隐藏HTML元素,看起来像通过向下滑动显示内容一样。
  2. : jQuery slideUp() method is used to hide the HTML element where it looks like the content is getting hidden by sliding up.

    :jQuery slideUp()方法用于隐藏看起来像通过向上滑动隐藏内容HTML元素。
  3. : jQuery slideToggle() method is used to toggle the HTML element with sliding hide and show effects. If the element is hidden, then it will show the element like slideDown() method. For visible elements, it will work as slideUp() method.

    :jQuery slideToggle()方法用于切换具有隐藏和显示效果HTML元素。 如果该元素是隐藏的,则它将显示该元素,如slideDown()方法。 对于可见元素,它将用作slideUp()方法。

Let’s look at all these jQuery slide methods with example programs.

让我们用示例程序查看所有这些jQuery幻灯片方法。

jQuery slideDown (jQuery slideDown)

jQuery slideDown() method is used for the downward sliding transition of the selected html elements. The height attribute of the selected element is animated which makes the lower parts of the elements to reveal with a sliding effect. The parameters passed in the slideDown() method determines the behaviour of this effect.

jQuery slideDown()方法用于所选html元素的向下滑动过渡。 所选元素的height属性具有动画效果,这使元素的下部具有滑动效果。 在slideDown()方法中传递的参数确定此效果的行为。

Here is the general syntaxes for using slideDown() method.

这是使用slideDown()方法的常规语法。

  1. slideDown(duration);

    slideDown(duration);
  2. slideDown(duration, callBackfunction);

    slideDown(持续时间,callBackfunction);
  3. slideDown(speed, easing, callBackfunction);

    slideDown(速度,缓动,callBackfunction);
  4. slideDown(options);

    slideDown(options);

duration: The values of the duration are specified in milliseconds. We can also give string values like “slow” and “fast”. Default duration is 400 milliseconds.

duration持续时间的值以毫秒为单位。 我们还可以给定字符串值,例如“ slow”和“ fast”。 默认持续时间为400毫秒。

callBackfunction: This function is fired after the completion of sliding transition.

callBackfunction :滑动转换完成后会触发此函数。

easing: This parameter determines which easing function like “swing” or “linear” is used for transition. “swing” is the default value.

缓动 :此参数确定使用哪种缓动功能(例如“ swing”或“ linear”)进行过渡。 默认值是“ swing”。

options: This could be anything like duration, callBackfunction, easing, special easing etc.

options :可以是持续时间,callBackfunction,缓动,特殊缓动等。

jQuery slideDown示例 (jQuery slideDown Example)

The following example demonstrates the slideDown() method. In this example, slideDown() method takes two parameters; duration with value “slow” and a call back function. When you run this demo, you can see the call back function fires after the sliding effect.

下面的示例演示了slideDown()方法。 在此示例中,slideDown()方法采用两个参数; 持续时间,值“ slow”和回调函数。 运行此演示时,您可以看到在滑动效果后触发了回调函数。

jQuery-slideDown.html

jQuery-slideDown.html

jQuery Slide Down 
JournalDev
jQuery SlideDown

You might have met with the slide down effects in many web pages. This is how we accomplish the slide down effect in jQuery. The parameters passed to this method is similar to the jQuery hide() and show() method. Below is the output produced by above jQuery slideDown example.

您可能已经在许多网页中遇到了滑倒效果。 这就是我们如何实现jQuery中的下滑效果。 传递给此方法的参数类似于jQuery hide()和show()方法。 下面是上面的jQuery slideDown示例产生的输出。

jQuery slideUp (jQuery slideUp)

jQuery slideUp method is used for the upward sliding transition of the selected html elements. The height attribute of the selected element is animated which makes the lower parts of the elements to conceal with a sliding effect. The parameters passed in the slideUp() method determines the behaviour of this effect.

jQuery slideUp方法用于所选html元素的向上滑动过渡。 选定元素的height属性具有动画效果,使元素的下部隐藏起来具有滑动效果。 在slideUp()方法中传递的参数确定此效果的行为。

Here is the general syntaxes for using slideUp() method.

这是使用slideUp()方法的常规语法。

  1. slideUp (duration);

    slideUp(持续时间);
  2. slideUp (duration,callBackfunction);

    slideUp(duration,callBackfunction);
  3. slideUp (speed,easing,callbackMethod);

    slideUp(speed,easing,callbackMethod);
  4. slideUp (options);

    slideUp(选项);

duration: The values of the duration are specified in milliseconds. We can also give string values like “slow” and “fast“. Default duration is 400 milliseconds.

duration持续时间的值以毫秒为单位。 我们还可以提供字符串值,例如“ slow ”和“ fast ”。 默认持续时间为400毫秒。

callBackfunction: This function is fired after the completion of sliding transition.

callBackfunction :滑动转换完成后会触发此函数。

easing: This parameter determines which easing function like “swing” or “linear” is used for transition. “swing” is the default value.

缓动 :该参数确定使用哪种缓动功能(例如“ swing ”或“ linear ”)进行过渡。 默认值是“ swing”。

options: This could be anything like duration, callBackfunction, easing, special easing etc.

options :可以是持续时间,callBackfunction,缓动,特殊缓动等。

jQuery slideUp示例 (jQuery slideUp Example)

The following example demonstrates the slideUp() method. In this example, slideUp() method takes two parameters; duration with value “slow” and a call back function. When you run this demo, you can see the call back function fires after the sliding effect.

下面的示例演示了slideUp()方法。 在此示例中,slideUp()方法采用两个参数; 持续时间,值“ slow”和回调函数。 运行此演示时,您可以看到在滑动效果后触发了回调函数。

jQuery-slideUp.html

jQuery-slideUp.html

jQuery Slide Up 
JournalDev
jQuery SlideUp

This is how we accomplish the sliding up effect in jQuery. The parameters passed to this method is similar to the jQuery hide() and show() method. This will be a handy method while designing web pages.

这就是我们如何实现jQuery中的向上滑动效果。 传递给此方法的参数类似于jQuery hide()和show()方法。 在设计网页时,这将是一种方便的方法。

jQuery slideToggle (jQuery slideToggle)

jQuery slideToggle method is used to hide or display the selected html elements. The height attribute of the selected element is animated which makes the lower parts of the elements to reveal or conceal with a sliding transition. The slideToggle() method checks the visibility of the selected element first. If the element is visible then it will trigger the slideUp() method else it triggers slideDown() method.

jQuery slideToggle方法用于隐藏或显示选定的html元素。 选定元素的height属性是动画的,这使元素的下部可以通过滑动过渡来显示或隐藏。 slideToggle()方法首先检查所选元素的可见性。 如果该元素可见,则它将触发slideUp()方法,否则将触发slideDown()方法。

Here is the general syntaxes for using slideToggle method.

这是使用slideToggle方法的常规语法。

  1. slideToggle (duration);

    slideToggle(持续时间);
  2. slideToggle (duration,callBackfunction);

    slideToggle(duration,callBackfunction);
  3. slideToggle (speed,easing,callbackMethod);

    slideToggle(speed,easing,callbackMethod);
  4. slideToggle (options);

    slideToggle(选项);

duration: The values of the duration are specified in milliseconds. We can also give string values like “slow” and “fast”. Default duration is 400 milliseconds.

duration持续时间的值以毫秒为单位。 我们还可以给定字符串值,例如“ slow”和“ fast”。 默认持续时间为400毫秒。

callBackfunction: This function is fired after the completion of sliding transition.

callBackfunction :滑动转换完成后会触发此函数。

easing: This parameter determines which easing function like “swing” or “linear” is used for transition. “swing” is the default value.

缓动 :此参数确定使用哪种缓动功能(例如“ swing”或“ linear”)进行过渡。 默认值是“ swing”。

options: This could be anything like duration, callBackfunction, easing, special easing etc.

options :可以是持续时间,callBackfunction,缓动,特殊缓动等。

jQuery slideToggle示例 (jQuery slideToggle Example)

The following example demonstrates the slideToggle() method. In this example, slideToggle() method takes two parameters; duration with value “slow” and a call back function. When you run this demo, you can see the call back function triggers after the sliding effect.

下面的示例演示了slideToggle()方法。 在此示例中,slideToggle()方法采用两个参数; 持续时间,值“ slow”和回调函数。 运行此演示时,可以看到滑动效果后触发了回调函数。

jQuery-slideToggle.html

jQuery-slideToggle.html

jQuery Slide Toggle 
JournalDev
jQuery SlideToggle

This is how we toggle between hide and display of the html elements with a sliding transition. The parameters passed in the slideToggle() method is similar to slideUp() and slideDown() methods.

这是我们通过滑动过渡在html元素的隐藏和显示之间切换的方式。 在slideToggle()方法中传递的参数类似于slideUp()和slideDown()方法。

jQuery slideDown,slideUp和slideToggle演示 (jQuery slideDown, slideUp and slideToggle Demo)

You can use below links to see jQuery slide up, slide down and slide toggle effects in action.

您可以使用下面的链接查看jQuery的滑动,滑动和滑动切换效果。

That’s all for jQuery sliding effects for showing and hiding DOM elements, we will be looking into more jQuery effects in future posts.

这就是用于显示和隐藏DOM元素的jQuery滑动效果,在以后的文章中我们将研究更多jQuery效果。

翻译自:

slideup

转载地址:http://yoqzd.baihongyu.com/

你可能感兴趣的文章
JavaBean规范
查看>>
第四阶段 15_Linux tomcat安装与配置
查看>>
NAS 创建大文件
查看>>
学习笔记-模块之xml文件处理
查看>>
接口测试用例
查看>>
面试:用 Java 实现一个 Singleton 模式
查看>>
Sybase IQ导出文件的几种方式
查看>>
案例:手动输入一个字符串,打散放进一个列表,小写字母反序 大写字母保持不变...
查看>>
linux 系统下 tar 的压缩与解压缩命令
查看>>
阿里负载均衡,配置中间证书问题(在starcom申请免费DV ssl)
查看>>
转:How to force a wordbreaker to be used in Sharepoint Search
查看>>
MySQL存储过程定时任务
查看>>
Python中and(逻辑与)计算法则
查看>>
POJ 3267 The Cow Lexicon(动态规划)
查看>>
设计原理+设计模式
查看>>
音视频处理
查看>>
tomcat 7服务器跨域问题解决
查看>>
前台实现ajax 需注意的地方
查看>>
Jenkins安装配置
查看>>
个人工作总结05(第二阶段)
查看>>