jQuery实现弹窗动画(自下而上,自上而下,渐隐渐现)

您所在的位置:网站首页 报社职位从下往上 jQuery实现弹窗动画(自下而上,自上而下,渐隐渐现)

jQuery实现弹窗动画(自下而上,自上而下,渐隐渐现)

2024-07-15 01:27| 来源: 网络整理| 查看: 265

目录

弹窗自下而上,自上而下(slideDown(),slideUp()),可设置回调函数。slideToggle()能实现slideDown(),slideUp()这两种功能

弹窗渐隐渐现(fadeIn(),fadeOut()),可设置回调。fadeToggle()能实现fadeIn(),fadeOut()这两种功能

fadeTo(时间,透明度):可指定透明度

弹窗自下而上,自上而下(slideDown(),slideUp()),可设置回调函数。slideToggle()能实现slideDown(),slideUp()这两种功能 jQuery实现广告弹窗 #ad{ width: 300px; height: 300px; background-color: yellowgreen; bottom: 0; right: 0; position: fixed; display: none; } setTimeout(function(){ $("#ad").slideDown(2000); },1000) $(function(){ $("#closeBtn").click(function(){ $("#ad").slideUp("fast"); }) }) 关闭

弹窗渐隐渐现(fadeIn(),fadeOut()),可设置回调。fadeToggle()能实现fadeIn(),fadeOut()这两种功能 jQuery实现广告弹窗 #ad{ width: 300px; height: 300px; background-color: yellowgreen; bottom: 0; right: 0; position: fixed; display: none; } setTimeout(function(){ $("#ad").fadeIn(2000); },1000) $(function(){ $("#closeBtn").click(function(){ $("#ad").fadeOut("slow"); }) }) 关闭

fadeTo(时间,透明度):可指定透明度 jQuery实现广告弹窗 #ad{ width: 300px; height: 300px; background-color: yellowgreen; bottom: 0; right: 0; position: fixed; display: none; } setTimeout(function(){ $("#ad").fadeTo (1000,0.5);//0 完全透明;1 完全不透明 },1000) $(function(){ $("#closeBtn").click(function(){ $("#ad").fadeToggle("slow"); }) }) 关闭



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3