jquerytree's Introduction
jquerytree's People
jquerytree's Issues
code review 0228
1.你有很多初始化的样式的代码
$("li").children().hide();
$("li:has(ul)").addClass("listimage");
$("li:not(:has(ul))").addClass("sonimage");
不知道你有没有发现 因为你是在DOM加载完之后再运行js隐藏子元素的,所以会出现子元素闪一下然后隐藏的效果。对此,你可以给子元素加上一个默认的display:none
的class
,然后在需要显示的时候叠加class
。
2.关于动画
现在我的看法就是能用CSS transition或者animation的就用,jQuery的animate这个主要是在需要兼容IE的情况下使用的,现在CSS动画就是准主流,所以我们可以直接全面使用。你写这个组件,jQuery的主要作用就是addClass
和绑定click
事件,至于动画这些,就写在CSS里会比较好。
这个组件的效果还是实现的不错的,就先不用改了。下一个任务可以注意我说的这些点。
tree
- svg用法
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.