Is it possible to add transition like when loading a web page like when you hover a div with transition effect. example: cubeupload.com
相关问题
- HTML5 control
- 这段css代码的 @media 为什么在谷歌浏览器中不生效,Edge正常?
- 有知道比较好的前端开发网站么?
- Embedding snake game to engage website visitors ,
- How to calculate offsetWidth and scrollWidth for o
If you want the whole page to have a transition effect:
Preview jsFiddle: http://jsfiddle.net/tXeks/
Of course.
Simply use jQuery and jQuery.blockUI plugin and use some code such as:
In this case, when the page is ready the block is displayed, and when the whole page is loaded block is simply hidden. :)
Best is using plain javascript as You need to wait for jquery which often is loaded on the end of page, event that page is loaded. add this after body
For example of your example, a pure CSS solution:
That would make the link text color turn white on hover.
You can animate it with CSS transitions. http://www.w3schools.com/css3/css3_transitions.asp
You can do that, but not right out of the box using css3 and html5 only! what you can do, even without relying on heavier frameworks, is to apply to various element's onload events and append a css class when the onload events are firing!
lets say you make your body's css look like this :
you could then do something like this in javascript :
in some browsers the
this
variable within the body element is not really recognized, it's better to use document.body instead!this gives you the freedom to play with various css properties all at once within css,
transform : all 1s ease;
without the hassle of learning new frameworks at all!Here's a working example
Notice : This is, as requested, a html5/css3 solution! older browser may not support css
transitions
or theclassList
property!