html导航栏横向展开,jquery实现可横向和竖向展开的动态下滑菜单效果

本文实例讲述了jquery实现可横向和竖向展开的动态下滑菜单效果。分享给大家供大家参考。具体如下:

这里演示了两个下拉导航菜单的效果,用jquery.easing.1.3.js和jquery.naviDropDown.1.0.js以及jquery.hoverIntent.minified.js共同实现,最新的jquery版本也可以引入,在演示页面中,分别有横向水平向下滑出的下拉菜单,还有纵向垂直布局向右滑出的导航菜单,根据你的需要选择使用。

运行效果截图如下:

333ac7d734b5d7e17d194ca35447ed47.png

6f4418a5cf7aac4fc26da6d06b781710.png

在线演示地址如下:

具体代码如下:

jQuery纵向横向动态下拉导航菜单

//jquery.naviDropDown.1.0.js

(function($){

$.fn.naviDropDown = function(options) {

var defaults = {

dropDownClass: 'dropdown',

dropDownWidth: 'auto',

slideDownEasing: 'easeInOutCirc',

slideUpEasing: 'easeInOutCirc',

slideDownDuration: 500,

slideUpDuration: 500,

orientation: 'horizontal'

};

var opts = $.extend({}, defaults, options);

return this.each(function() {

var $this = $(this);

$this.find('.'+opts.dropDownClass).css('width', opts.dropDownWidth).css('display', 'none');

var buttonWidth = $this.find('.'+opts.dropDownClass).parent().width() + 'px';

var buttonHeight = $this.find('.'+opts.dropDownClass).parent().height() + 'px';

if(opts.orientation == 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值