3 Star 0 Fork 0

Gitee 极速下载 / square_menu_demo.html

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/peachananr/square_menu
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

#Square Menu by Pete R. Create a Square-like Menu Animation for Website using jQuery and CSS3 Created by Pete R., Founder of BucketListly

Demo

View demo

Compatibility

Modern browsers such as Chrome, Firefox, and Safari on both desktop and smartphones have been tested. I have not tested this on IE.

Basic Usage

Square menu, as you can see from the name, is a plugin that let you add a similar animated menu that you see on the new Square website. I've also added additional animations, add various browsers support and provide options for you to play around with.

To add this to your website, make sure you've included the latest jQuery library together with jquery.square_menu.js and square_menu.css into your document's <head>, and make sure your HTML markup are as follows:

<body>
  ..
  <div class="sidemenu">
    <nav class="left">
      <a href="...">...</a>
      <a href="...">...</a>
      <a href="...">...</a>
    </nav>
    <nav class="right">
      <a href="...">...</a>
      <a href="...">...</a>
      <a href="...">...</a>
    </nav>
  </div>
  ..
</body>

Note: Having 2 nav tags is very important for the plugin to function. Both these nav tags will be used to create a similar animation that you see on Square website. The content inside on the other hand, can be changed as you see fit.

Once that is done, simply call the function like this:

  $(".sidemenu").square_menu({
    flyDirection: "bottom", // The direction where the menu will fly from. Available options are "top", "bottom", "left", "right", "top-left", "top-right", "bottom-left" and "bottom-right". The default value is "bottom".
    button: "Menu", // You can define text inside the auto-generated button here. If you want to prevent the plugin from generating a menu button, change this to false. The default value is "Menu".
    animationStyle: "vertical", // The type of animation style you will see after it flew in. Available options are "vertical" which expands vertically and "horizontal" which expands horizontally. Vertical works best with "top" or "bottom" flyDirection whereas Horizontal works best with "left" or "right" flyDirection. The default value is "vertical".
    closeButton: "X" // You can define the content of the close button appears after animates are completed here. Change this to false to hide the close button. The default value is X.
  });

Public Method

$.fn.openMenu()

With this method, you can open your menu programmatically by calling the openMenu() function like this:

$(".sidemenu").openMenu();

$.fn.closeMenu()

Same goes for this method. You can close your menu programmatically by calling the closeMenu() function like this:

$(".sidemenu").closeMenu();

Now you will have a beautifully crafted menu animation like you see on Squareup.com website with little to no effort. If you like this kind of plugin, stay tuned for more from me. :)

If you want to see more of my plugins, visit The Pete Design, or follow me on Twitter and Github.

Other Resources

The MIT License (MIT) Copyright (c) 2013 Pete R. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Square Menu 是一个类似 Square 菜单动画效果的网站菜单,使用 jQuery 和 CSS3 开发的 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/mirrors/square_menu_demo.html.git
git@gitee.com:mirrors/square_menu_demo.html.git
mirrors
square_menu_demo.html
square_menu_demo.html
master

搜索帮助