views:

30

answers:

3

Hi,

I attached this style attribute to body tag:

style="background: -moz-radial-gradient(center center , circle , rgb(223, 224, 228), rgb(189, 193, 200)) no-repeat fixed 0% 0% #fff;"

And scrolling the page became very hard - it was lagging and scrolling slowly. Is it supposed to be so?

Edit: Not only scrolling, all other jquery effects become slow too.

A: 

Possibly it's because of the amount of resources the browser needs to display your CSS generated gradient on a background of an entire page. Which browser are you testing in?

Kyle Sevenoaks
3.6 - newest. actually there is not much to display. i've the background and div with filled background (height 1000px so scrolling would be possible).
Richards
+2  A: 

Its a known issue that a gradient background with background-position:fixed has perfomance problems.

This is the price you pay for using pre-release CSS (ie anything with a browser prefix such as -moz). Most of the time they work fine, but as long as they've got that prefix, it indicates that the vendor doesn't consider the feature to be finished, so you use it at your own risk.

Spudley
Thanks. However, even with the attachment "scroll" i have the same performance problems, even worse.
Richards
A: 

Firefox has a lot of issues with slow scrolling.. you can see all the bug reports at bugzilla https://bugzilla.mozilla.org/buglist.cgi?quicksearch=slow+scrolling

FutureKode
This answer is misleading - that search query is churning out hundreds of irrelevant bugs. Even then, this doesn't directly address the OP's question - unless you link to a bug concerning `-moz-radial-gradient` performance and scrolling, you're not answering the question.
Yi Jiang
I don't think misleading is the right word. It may not be the perfect answer but I believe it could be helpful to the asker of the question.
FutureKode