当前位置:Gxlcms > JavaScript > javascript手工制作悬浮菜单_javascript技巧

javascript手工制作悬浮菜单_javascript技巧

时间:2021-07-01 10:21:17 帮助过:4人阅读

有选择性的重复造一些轮子,未必是件坏事。Aaron的博客上加了一个悬浮菜单,貌似显得很高大上了。虽然这类小把戏也不是头一次见了,但是从未自己写过。今天就选择性的拿这个功能写一写。下面是这个轮子的开发过程,也可以当作是一篇需求文档的分析和实现过程。

演示地址:http://sandbox.runjs.cn/show/to8wdmuy

源码下载:https://github.com/bjtqti/floatmenu

第一步创建dom节构:

代码如下:





AppCarrier




test1


The past can hurt. But you can either run from it or learn from it


过去是痛楚的,但你要么逃避,要么从中成长


One meets his destiny on the road he takes to avoid it


往往在逃避命运的路上,却与之不期而遇


Rules are meant to be broken


规则就该被打破。


Years may wrinkle the skin, but to give up enthusiasm wrinkles the soul.


岁月流逝只令容颜苍老,激情不再却使心灵枯萎。


test2


只有不断地练习学到的知识,你才能真正掌握它。


Live every day to the fullest.


尽享每日。


Keep your eyes on the stars, and your feet on the ground.


志存高远,脚踏实地。


Always be up for an unexpected adventure.


随时准备开始一场意外冒险吧。


Life is full of disappointment. You can't dwell on things. You have to move on.


生活常不如意,别沉溺往事,要勇往直前。


I'm a free spirit. I can't be caged.


我的灵魂是自由的,不该被束缚。


Sometimes the heart sees what is invisible to the eye.


目不见者,心可感之


The simple things are also the most extraordinary things, and only the wise can see them.


最平凡的事也是最非凡的事,只有智者才明白。


test3


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


test4


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx


how many xxxxxx