I have a webpage, the background for which is going to be a flashlight. Is it possible to draw the flashlight so that the beam (a piece-of-pie shape) will expand, no matter the size of the user's browser? For example (love that ascii art):
/
/
/
/
________/ | /
| _ |/
|________ |\
\_| \
\
\开发者_如何学编程
\
\
With the rays expanding until they hit the side of the viewport.
I don't want to use a simple image because it will be a fixed size. I was also thinking of using a Javascript drawing library like Raphael, but I don't know if there's a better way.
You could use an oversized background image, center it on the element and if they use an extremely large screen the effect will still work.
精彩评论