Git Product home page Git Product logo

angularjs-popups-demo's Introduction

AngularJS-popups-demo

医护微定制应用产品开发中的高级搜索面板

A draft version of AngularJS-popups-demo.

基于 AngularJS 的浮层组件,由 artDialog 演进而来。angular-popups 是一个严格遵循 AngularJS 架构与 web 标准的组件:

  1. 使用 AngularJS 自带的 ng-ifng-showng-hide 控制浮层的显示、销毁
  2. 支持 ARIA 规范、无障碍焦点管理、快捷键关闭
  3. 完全基于 HTML 标签(指令),无需在控制器中进行配置
  4. 可以指定元素或鼠标事件对象($event)对齐
  5. 支持模态浮层
  6. 对移动端支持友好
  7. 轻量(css+js=7kb),不依赖 jQuery 等外部库

Prerequisites

You'll need git and a web browser.

Getting it

Run the following command to check out a local copy of the code.

git clone https://github.com/JenifferWuUCLA/angularjs-popups-demo.git

使用

支持使用 script 标签或者 webpack、requirejs、seajs 调用:

script

调用

<script src="lib/angular.js"></script>
<script src="dist/angular-popups.js"></script>
<script>
    var app = angular.module('app', ['angular-popups']);
</script>

webpack

调用

require('angular-popups');
var app = angular.module('app', ['angular-popups']);

angular-popups 依赖 angular 这个全局模块

指令

包含如下浮层指令:

浮层通用参数

名称 说明
ng-if 显示或隐藏浮层(DOM 插入或删除)
ng-show 显示浮层
ng-hide 隐藏浮层
for 指定元素对齐,传入目标元素 ID 即可
align 对齐的参数,此参数需要与 for 配合使用。默认 "bottom left",可选值:"top left" "top" "top right" "right top" "right" "right bottom" "bottom right" "bottom" "bottom left" "left bottom" "left" "left top"
fixed 使用固定定位,等同于 CSS position:fixed
modal 模态浮层
duration 自动关闭的时间(单位毫秒)
close 浮层关闭事件
close-action 配置浮层由什么动作来触发关闭(执行 close 事件)。默认 "esc timeout" ,所有支持的动作: "esc timeout outerchick click"

ng-ifng-show 如果传入的是 $event,则浮层会定位到事件触发位置

dialog

对话框指令

子指令

名称 说明
dialog-title 对话框标题容器
dialog-content 对话框内容容器
dialog-buttons 对话框按钮容器
dialog-statusbar 对话框状态栏容器

对话框子指令中的事件可以使用 $close() 这个函数,它会调用通用参数 close 中的表达式

兼容性

  • Chrome
  • Firefox
  • IE9+

Running it

Because we are pulling files from a CDN, we are going to need to run angularjs-popups-demo from a web server. There are a few ways to do this, but one of the easiest ways is to use the npm package serve.

The steps are as follows:

  1. Install Node.js. You can find all of the information to do that here.
  2. Install the serve package by running npm install -g serve from the command line.
  3. Navigate to the angularjs-popups-demo directory from the command line and run serve.
  4. Go to http://localhost:5000 in your browser to see the application.

Main Page

angularjs-popups-demo's People

Contributors

jenifferwuucla avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.