What is the best way to apply shadow?

What is the best method for applying shadow? I am currently working on a site where we have a lot of them, but I struggled to find the best way to do this. The site is quite animated, so the shadows should work well with this.

I tried jQuery shadow pulgin. The shadows looked good and were easy to use, but they were slow and didn’t work very well with the animation (it took a lot of redrawing, very thick).

I also tried to create my own jQuery extension, which wraps my element in a pair of gray divs and then casts them a bit to give a shadow effect. It worked out well. It responds quickly to animations. However, this makes DOM manipulation / traversal cumbersome as everything is wrapped in these shadow divs.

I know that there must be a better way, but this is not exactly my forte. Thoughts?

+3
source share
5 answers

ShadedBorder is a good and easy to use Shadow-Library. check it out

+3
source

You do not need to wrap these shadow divs around other content, just ask them some problems and put them at a lower z-index! -)

+1
source

, DOM, / JQuery. , ref , .

0
0

, , , . , IE6, alpha-PNG ​​ , , .

, , caching-PHP script, , , . ( HTTP-) , Javascript/CSS.

, , , , , , .

0

Source: https://habr.com/ru/post/1698745/


All Articles