Git Product home page Git Product logo

popup's Introduction

Popup

##目前支持的功能 1、只支持悬窗在上、下、左、右、鼠标点,及四个角点的显示;

2、当悬窗高、宽小于页面高宽时,悬框会选择最佳的位置进行展示;

  例如,用户设置右侧显示悬框,此时悬框会超出屏幕,可读性变差;
  
  程序自动调整位置显示,即在另外三个位置找到可以全部展示悬窗的位置;
  
  若其他三个位置均不能完全展示,那么悬窗会在用户的设置的位置显示;

3、支持悬浮框在上、下、左、右位置与元素居中对齐;

4、返回目标元素外边框中心点与悬窗之间的相对位置,以便对悬窗设置锚点效果;

5、支持单例弹窗和多弹窗;(目前只支持一组元素内的单一弹窗;)

============================= ##TODO:

1、支持各角点,左上,左下,右上,右下的展示;(done)

2、并根据悬框大小自动适配位置;(partical done)

2、当悬窗宽度大于页面宽度时,强制重新设置悬框宽度,以便能正常显示;(这个需求暂时舍掉不做)

3、提取js和css为独立的文件,文件的组成符合github推荐的方式;(done)

4、合并避让方式,消除冗余代码;(done)

5、悬浮窗没有脱离文档流,在父容器中有一个显示区域;

6、添加是否自动适配位置的参数;默认不自动适配,false;

##googlecode上有类似的控件

http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/hovercard.html

##需要注意的地方: 悬浮窗内的包装元素需要设置固定高宽;否则IE6/7下会出现位置计算不准确的情况; 或者设置禁止自动折行‘white-space:nowrap;’

popup's People

Contributors

charleslei avatar

Watchers

 avatar  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.