[SOLVED] About "background-image: fixed;" Scrolling Issues

This is a discussion on "[SOLVED] About "background-image: fixed;" Scrolling Issues" within the Web Page Design section. This forum, and the thread "[SOLVED] About "background-image: fixed;" Scrolling Issues are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 11th, 2008, 17:13
Junior Member
Join Date: Mar 2008
Location: UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] About "background-image: fixed;" Scrolling Issues

Consider the following CSS:

Code: Select all
html, body  {
    font-family: verdana, arial, helvetica;
    font-size: 11px;
    color: #B38446;
    background-color: #000000;
    background-image: url('images/background.gif');
    background-position: 0% 0%;
    background-attachment: fixed;
}
I have found in both FireFox and IE that although the background is fixed to the specified position, the scrolling is extremely choppy.

I have also searched and searched and searched for a solution to this problem. If I take out the fixed command, the scrolling is perfect.

How can I use the background-attachment: fixed command and maintain perfect, or at least smoother scrolling?
Reply With Quote

  #2 (permalink)  
Old Apr 13th, 2008, 14:18
Junior Member
Join Date: Mar 2008
Location: UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: About "background-image: fixed;" Scrolling Issues

Aww. Someone must have some light to shed on this.

Ok, the problem is that I want to position my background image with the variables of "0% 0%" but the "background-position" command only works together with the "background-attachment :fixed;" command.

I don't mind having a scrolling background if I can use the position command.

That said can anyone advise then how to either:

a. Use the "background-attachment: fixed;" command and maintain perfect, or at least smoother scrolling

or

b. Use the position command without "background-attachment: fixed;"

Many thanks for any helpful responses.
Reply With Quote
  #3 (permalink)  
Old Apr 13th, 2008, 16:28
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,010
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: About "background-image: fixed;" Scrolling Issues

Firstly I should clarify background-position does work, even without a fixed attachment.

However, you are correct in saying that it does not have the same effect as background-attachment: fixed.

background-position will set the position of the background in relation to the size of the browser viewport at load, but will then scroll with the content (if it overflows the viewport size).

As to your problem, I very much doubt there is anything you can do with regards to 'chopiness.' CSS won't be the only issue; system hardware (particularly graphic cards) play a major role in the 'smoothness' of internet browsing.

Have you got a link to a demo, so other users can test out the scenario?
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #4 (permalink)  
Old Apr 13th, 2008, 16:38
Junior Member
Join Date: Mar 2008
Location: UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: About "background-image: fixed;" Scrolling Issues

Interesting.

If you reconsider the original CSS code I provided in my first post; well, if I remove the background-attachment: fixed; command it no longer positions to the 0% 0% co-ordinates but instead positions itself around the main table content, and then badly tiles the excess/exterior of the page at different co-ordinates. Resulting in an additional superfluous background tile.

I'm currently editing it offline so can't show you a working page. Everything works fine, it's just what happens if I remove the fixed command.
Reply With Quote
  #5 (permalink)  
Old Apr 13th, 2008, 16:40
Junior Member
Join Date: Mar 2008
Location: UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: About "background-image: fixed;" Scrolling Issues

According to w3schools Firefox doesn't support the positition command without fixed, but it appears for me that neither does IE.
Reply With Quote
  #6 (permalink)  
Old Apr 13th, 2008, 16:42
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,010
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: About "background-image: fixed;" Scrolling Issues

If you don't specify a backround-repeat, then you won't see the effect of background-position as the browser will tile the image everywhere!

EDIT: Firefox most definitely supports background-position.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #7 (permalink)  
Old Apr 13th, 2008, 16:48
Junior Member
Join Date: Mar 2008
Location: UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: About "background-image: fixed;" Scrolling Issues

Oh I see. I'll add in the repeat command and see what happens.

Here's the link to what w3schools said:

http://www.w3schools.com/css/pr_background-position.asp

Thanks for your advice.
Reply With Quote
  #8 (permalink)  
Old Apr 13th, 2008, 17:07
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,010
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: About "background-image: fixed;" Scrolling Issues

I believe W3 Schools are referring to the original Mozilla browser. Either way, I can assure you background-position works in Firefox
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #9 (permalink)  
Old Apr 13th, 2008, 18:32
Junior Member
Join Date: Mar 2008
Location: UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: About "background-image: fixed;" Scrolling Issues

I've added the repeat command:

Code: Select all
html, body  {
    font-family: verdana, arial, helvetica;
    font-size: 11px;
    color: #B38446;
    background-color: #000000;
    background-image: url('images/background.gif');
    background-position: 0% 0%;
    background-repeat: repeat;
    background-attachment: scroll;
}
However, it still does not work unless I specify the background-attachment: fixed; command.
Reply With Quote
  #10 (permalink)  
Old Apr 13th, 2008, 18:54
Junior Member
Join Date: Mar 2008
Location: UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: About "background-image: fixed;" Scrolling Issues

Ah, splitting the html assignments from the body assignments solved my solution.

Code: Select all
html    {
    background-color: #000000;
    background-image: url('images/background.gif');
    background-position: 0% 0%;
    background-repeat: repeat;
    background-attachment: scroll;
}

body  {
    font-family: verdana, arial, helvetica;
    font-size: 11px;
    color: #B38446;
}
Thanks for your time.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a "tag" system to find relevant "related" pages MrQuestions PHP Forum 3 Mar 20th, 2008 23:06
[SOLVED] Show "Image" Depends On User "Status"? Monie Classic ASP 6 Oct 16th, 2007 01:22
? IS "meta name="robots" content="?" necessary in pages ? Love2Java Starting Out 6 Aug 8th, 2007 13:48
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript Forum 0 Feb 17th, 2007 23:09
background IMAGE"S" need one on left one on right bruno89 Web Page Design 11 Jan 28th, 2007 05:15


All times are GMT. The time now is 22:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43