导航菜单 gooey-menu jQuery液态融合(gooey)样式导航菜单插件(精)

gooey-menu是一款基于SVG过滤器的液态融合(gooey)样式导航菜单jQuery插件。通过该插件你可以非常轻松的制作出各种gooey样式的环形菜单特效。

这里写图片描述

查看原文

查看在线演示Demo和更多原文内容教程:http://www.ibloger.net/article/1799.html

使用方法
使用该导航菜单插件需要在页面中引入gooey.min.css文件,jquerygooey.min.js文件。

<link rel="stylesheet" href="gooey.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/gooey.min.js"></script>          

HTML结构

gooey样式的环形菜单的基本HTML结构是创建一个汉堡包图标,当用户点击汉堡包图标时打开菜单。

<nav id="gooey-upper">
  <input type="checkbox" class="menu-open" name="menu-open1" id="menu-open1"/>
  <!-- 汉堡包图标 -->
  <label class="open-button" for="menu-open1">
    <span class="burger burger-1"></span>
    <span class="burger burger-2"></span>
    <span class="burger burger-3"></span>
  </label>

  <!--环形菜单-->
  <a href="#features" class="gooey-menu-item"> 
    <i title="Features" class="fa fa-cog fa-2x"></i> 
  </a>
  <a href="#h-spaced-menu" class="gooey-menu-item"> 
    <i title="Horizontal Menu" class="fa fa-arrows-h fa-2x"></i> 
  </a>
  <a href="#menu-v-example" class="gooey-menu-item"> 
    <i title="Vertical Menu" class="fa fa-arrows-v fa-2x"></i> 
  </a>
  <a href="#docs" class="gooey-menu-item"> 
    <i title="Docs" class="fa fa-book fa-2x"></i> 
  </a>
  <a href="#event-api" class="gooey-menu-item"> 
    <i title="Event API" class="fa fa-code fa-2x"></i> 
  </a>
  <a href="#round" class="gooey-menu-item"> 
    <i title="Round Menu" class="fa fa-circle fa-2x"></i> 
  </a>
 </nav>

初始化插件

在页面DOM元素加载完毕之后,可以通过gooeymenu()方法来初始化该菜单插件。

$("#gooey-demo").gooeymenu({

  // 配置参数

});

配置参数
该gooey样式的环形菜单的默认配置参数如下:

$("#gooey-demo").gooeymenu({

  // 'horizontal', 'circle' or 'vertical'
  style: "horizontal",
  size: 70,
  margin: "medium",
  bgColor: "steelblue",
  contentColor: "white",
  transitionStep: 100,
  bounce: false,
  bounceLength: "medium",
  hover: "white",
  circle: {
      radius: 80
  },
  horizontal: {
      menuItemPosition: "glue"
  },
  vertical: {
      menuItemPosition: "spaced",
      direction: "up"
  }

});        
  1. style:gooey菜单的样式,可用值有:”horizontal”,”vertical”,”circle”。
  2. size:菜单项的尺寸,单位像素。
  3. margin:菜单项之间的margin值。只有在”horizontal” 或 “vertical”参数设置为”spaced”时才有效。可用值有:”small”,”medium” 和 “large”。
  4. bgColor:设置菜单项的背景颜色。
  5. contentColor:设置菜单项的字体颜色。
  6. transitionStep:设置菜单项打开的速度,单位毫秒。
  7. bounce:是否打开”bounce”效果。
  8. bounceLength:如果打开了”bounce”效果,设置bounce的长度。可用值有:”small”, “medium” 和 “large”。
  9. hover:设置鼠标滑过菜单项时的颜色。
  10. circle:设置菜单打开时圆形的半径。
  11. horizontal:menuItemPosition:设置为”Spaced”表示要指定菜单项之间的margin值。设置为”Glue”表示菜单项堆叠在一起。
  12. vertical:menuItemPosition:设置为”Spaced”表示要指定菜单项之间的margin值。设置为”Glue”表示菜单项堆叠在一起。
  13. vertical:direction:菜单的垂直展开方向,可用值有:”up” 或 “down”。

回调函数

  • open:function(){}:菜单打开是触发。
  • close:function() {}:菜单关闭时触发。

gooey-menu导航菜单插件的github地址为:https://github.com/dominicdomu/gooey-menu

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
黏贴效果的圆形菜单, 效果很逼真。项目地址:https://github.com/anshulagarwal2k/GooeyMenu 效果图:如何使用:首先你需要创建菜单项的数组<array name="drawable_array">         <item>@drawable/item_selector</item>         <item>@drawable/selector_video</item>         <item>@drawable/selector_audio</item>         <item>@drawable/selector_photo</item>         <item>@drawable/selector_doc</item>     </array>2. 创建菜单实例<android.anshul.com.gooeymenu.GooeyMenu>,并将上面的数组加到menu_drawable属性中:<android.anshul.com.gooeymenu.GooeyMenu         android:id="@ id/gooey_menu"         android:layout_width="match_parent"         android:layout_height="match_parent"         app:fab_radius="@dimen/big_circle_radius"         app:gap_between_menu_fab="@dimen/min_gap"         app:menu_radius="@dimen/small_circle_radius"         app:no_of_menu="5"         app:menu_drawable="@array/drawable_array"/>3. 位菜单添加监听mGooeyMenu = (GooeyMenu) findViewById(R.id.gooey_menu); mGooeyMenu.setOnMenuListener(new GooeyMenu.GooeyMenuInterface(){ @Override public void menuOpen() { showToast("菜单打开了"); } @Override public void menuClose() { showToast( "菜单关闭了"); } @Override public void menuItemClicked(int menuNumber) { showToast( "你选择了某一菜单项 : "   menuNumber); }                  });

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值