472,981 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 software developers and data experts.

Fluid container with tiling background

One thing that has always annoyed me, and I just design around it, is having
a tile that you want to use for your background image that doesn't
seamlessly tile, in a container that you want to be fluid. I had a go at
it, but had to use javascript:

http://nrkn.com/fluidTiling/

Question, anyone have *any* ideas about how you could do it without the JS?

Nov 27 '07 #1
7 2198
rf

"Nik Coughlin" <nr******@gmail.comwrote in message
news:fi**********@aioe.org...
One thing that has always annoyed me, and I just design around it, is
having a tile that you want to use for your background image that doesn't
seamlessly tile, in a container that you want to be fluid. I had a go at
it, but had to use javascript:

http://nrkn.com/fluidTiling/
>
Question, anyone have *any* ideas about how you could do it without the
JS?
Notice that you have to "do" stuff to make this happen. More precicely you
have to *do* stuff to certain margins on browser resize. Since neither HTML
nor CSS actually *do* stuff, but merely describe how other stuff is layed
out (they are not programming, despite the L in HTML), you are IMHO out of
luck.

BTW it does work in IE6 and IE5.5 but with horrendous flashing as the page
is made wider. These browsers fire onresize after every mouse move, not at
the end of the resize operation - a page re-layout re-paint after every
pixel and the repaint is not smart, it erases the canvas to white and then
paints the new content.

--
Richard.
Nov 27 '07 #2
"rf" <rf@invalid.comwrote in message
news:m4*******************@news-server.bigpond.net.au...
>
"Nik Coughlin" <nr******@gmail.comwrote in message
news:fi**********@aioe.org...
>One thing that has always annoyed me, and I just design around it, is
having a tile that you want to use for your background image that doesn't
seamlessly tile, in a container that you want to be fluid. I had a go at
it, but had to use javascript:

http://nrkn.com/fluidTiling/
>>
Question, anyone have *any* ideas about how you could do it without the
JS?

Notice that you have to "do" stuff to make this happen. More precicely you
have to *do* stuff to certain margins on browser resize. Since neither
HTML nor CSS actually *do* stuff, but merely describe how other stuff is
layed out (they are not programming, despite the L in HTML), you are IMHO
out of luck.
Yeah, I thought as much, but I also thought that maybe some jiggery pokery
magic with percentage widths, negative margins etc. might be able to hack
together into something that works. Haven't thought that approach through
far enough to know for sure but I suspect that it wouldn't be possible.
BTW it does work in IE6 and IE5.5 but with horrendous flashing as the page
is made wider. These browsers fire onresize after every mouse move, not at
the end of the resize operation - a page re-layout re-paint after every
pixel and the repaint is not smart, it erases the canvas to white and then
paints the new content.
Yuck.

Nov 27 '07 #3
Nik Coughlin wrote:
One thing that has always annoyed me, and I just design around it, is
having a tile that you want to use for your background image that
doesn't seamlessly tile, in a container that you want to be fluid. I
had a go at it, but had to use javascript:

http://nrkn.com/fluidTiling/

Question, anyone have *any* ideas about how you could do it without the JS?
I can think of a couple of ways to do that without Javascript, but all
of them are far less elegant than just using the JS :P

Jeremy
Nov 28 '07 #4
In article <Wp*****************@newsfe24.lga>,
Jeremy <je****@pinacol.comwrote:
Nik Coughlin wrote:
One thing that has always annoyed me, and I just design around it, is
having a tile that you want to use for your background image that
doesn't seamlessly tile, in a container that you want to be fluid. I
had a go at it, but had to use javascript:

http://nrkn.com/fluidTiling/

Question, anyone have *any* ideas about how you could do it without the JS?

I can think of a couple of ways to do that without Javascript, but all
of them are far less elegant than just using the JS :P
What are these ways?

--
dorayme
Nov 28 '07 #5
In article <IQ**************@newsfe19.lga>,
Jeremy <je****@pinacol.comwrote:
dorayme wrote:
In article <Wp*****************@newsfe24.lga>,
Jeremy <je****@pinacol.comwrote:
Nik Coughlin wrote:
One thing that has always annoyed me, and I just design around it, is
having a tile that you want to use for your background image that
doesn't seamlessly tile, in a container that you want to be fluid. I
had a go at it, but had to use javascript:

http://nrkn.com/fluidTiling/

Question, anyone have *any* ideas about how you could do it without the
JS?
I can think of a couple of ways to do that without Javascript, but all
of them are far less elegant than just using the JS :P
What are these ways?

OK, here is one (I can't resist a good CSS challenge)

http://www.duckwizard.com/ciwas/square.html
OK, looks quite clever an attempt. I guess it would be tricky to
adjust to the surrounding not overlaying the text at the bottom
(in my FF and Safari) when the font size is upped a notch or two
by the user?

It fails a bit in Safari, the right vertical col is not clean (it
is one and a bit 'question boxes' wide. So still not up to Nick's
js in simple performance. Not yet at any rate. <g>

My swim is coming up soon. Got to go.

--
dorayme
Nov 28 '07 #6
Nik Coughlin wrote:
>
Still, very cool. Breaks in some situations, but I think we have gone
beyond real world usage here anyway :) Now I'm gonna have to try and
think of another out-of-left-field way to do it...
I think a Javascript solution is your best bet; it may not look terrific
for the fraction of people with JS disabled, but the page will still
function correctly and that's the important thing.

However, there are a couple of things you could do to improve the JS
solution, particularly for IE. One thing I can think of is using a
short timeout to update the box, and canceling the timeout if it hasn't
already occurred by the next resize. That way you will avoid the
constant redrawing that causes it to look so bad in IE during the resize
(essentially making it behave like Firefox does, where it only updates
when you stop resizing).

But that's getting off topic (and you probably already know you can
improve the JS). By the way, your page works fine in IE6.

Jeremy
Nov 28 '07 #7
dorayme wrote:
>
OK, looks quite clever an attempt. I guess it would be tricky to
adjust to the surrounding not overlaying the text at the bottom
(in my FF and Safari) when the font size is upped a notch or two
by the user?

It fails a bit in Safari, the right vertical col is not clean (it
is one and a bit 'question boxes' wide. So still not up to Nick's
js in simple performance. Not yet at any rate. <g>

My swim is coming up soon. Got to go.
Yeah - text size adjustment is the least of the problems. The bigger
problem is that you have to calculate for each content box how many
floating squares you need to pad the box out enough. And then - like
you said - it will break if someone has a text size that doesn't mesh
with yours.

I tried this with 32em width and height to account for this (which
theoretically should work to some degree, as the grid boxes will always
be a multiple of 32px IF the font size is an integer) - not only was the
quantization level much too great for it to be useful, but the text size
is apparently NOT always an integral number of pixels (which surprised me).

Anyway, I don't think a CSS solution exists that would be more elegant
than a good Javascript solution. Javascript is great for adding extra
decoration features - as long as it's unobtrusive and gracefully degrades.

Jeremy
Nov 28 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Winter | last post by:
This is a totally trivial CSS problem, I'm sure, but I don't get it. I want a centered DIV with a fixed width between two other DIVs that should fill the rest of the window/viewport (= 100%). How...
0
by: Jim Hubbard | last post by:
By true tiling I do not mean the Vertical tiling or horizontal tiling like .... 1 2 3 4 or
8
by: Ron Holmes | last post by:
I want to place a background image on a windows form. Is there a way to prevent the image from Tiling without using an image box resized to the size of the form? I am using Visual Studio 2003...
3
by: Sridhar | last post by:
Hi, I have created a user control which has the html code as follows <TABLE id="ToolBarTable" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td align="right"...
3
by: Viken Karaguesian | last post by:
Hello all, I need somehelp with background tiling. I have a sneaking suspicion that what I want to do is not possible, but I'll ask anyway. :>) First some background: Here's the site in...
0
by: kirby.urner | last post by:
Probably a fault line or cultural divide between acutely differing schools of thought, is in this area of tiling or mosaic making. Some schools consider this a stupid waste of time, others a core...
2
by: lister | last post by:
I want to center a fluid DIV horizontally. I've tried making the margins auto, but this doesn't work. Can anyone help? CSS drives me nuts! demo here:...
1
by: lister | last post by:
Hi, I have a div with fluid content, below which I want a scrollable div. I can't work out how to style the scrollable div to say "use the rest of the space in the container". The best I can...
3
by: hzgt9b | last post by:
I want a page with a centered div containing two rows. Top row has an image and some text. The bottom row needs to have three columns. I'd love to have the 1st column set to a fixed width then have...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.