A Conversation for The H2G2 Programmers' Corner

Back ground

Post 1

manda1111


Hi smiley - biggrin

I want to have a picture as the background to my web page, how do I do it smiley - smiley

manda smiley - peacedove


Back ground

Post 2

Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista)

Manda, check out:

http://hotwired.lycos.com/webmonkey/teachingtool/bgimg.html


Back ground

Post 3

manda1111


Thanks Peet

thats just what I wanted smiley - ok

madna smiley - peacedove


Back ground

Post 4

Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista)

smiley - geeksmiley - biggrin


Back ground

Post 5

Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista)

("madna" smiley - huhsmiley - laugh)


Back ground

Post 6

Loup Dargent

"smiley - runs and snatches the mask off the mysterious madna..."

Oh hi Manda...smiley - biggrin

Peet... While we're on the subject of backgrounds for web pages, my attempts to start one [web page] have brought me two questions without answers...

As you can see in my [under construction for quite a long time to come] Buffy page http://www.angelfire.com/weird2/loup.dargent/buffy_corner.html i've got a scrolling background... What i'm wondering is if there is a way to make it go slower...smiley - grovel

Also, before even daring starting the page i came across some info about another way of playing with the background... Instead of having the background scrolling down like on the page, the text [which would be in the same frame than the background picture in that case] was actually moving up while the background picture was staying put... i liked the idea but i can't find the coding anymore anywhere...smiley - wahsmiley - wah Any tips/hints/etc..?!

smiley - ta in advance...smiley - smiley

loupsmiley - fullmoon


Back ground

Post 7

Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista)

It's very smiley - cool, but I'll need to give it some thought. There's no simple answer, as (in case you didn't notice) it scrolls at different speeds in different browsers. smiley - erm

I have it in Mozilla on one screen, and IE on another (same machine smiley - geeksmiley - nahnah) and the IE scrolls about twice as fast as the Mozilla. smiley - erm There's also a nasty "jump" every so often, on both. As I say, it needs investigating, and I'm not really awake enough to do that tonight. smiley - yawn


Back ground

Post 8

Loup Dargent

smiley - cheers Peet...smiley - smiley

No hurry though... I still have to add some links and stuff anyway before it remotely starts to look like i would like/hope it to look...

The great thing is that a lot of the links will be h2g2 and Talk Buffy ones...smiley - cool So i'm not straying away too much...smiley - whistle Plus some other h2g2 researchers are contributing to it as well with some ideas/infos/etc... Should eventually become an interesting "not h2g2 page but still h2g2 influenced" kind of web page...smiley - disco

I also want to experiment with some other things... So as i said, no hurry...smiley - smiley

I'm using IE and Opera as browsers and noticed some difference in speed, but i assumed that it was due to my PC's erratic behaviour... Hmmmmm... I'm going to have to do a lot of grovelling now that it appears that it was not its fault...[smiley - silly]

Talk soon and thanks again smiley - ta...smiley - surfer

loupsmiley - fullmoon


Back ground

Post 9

Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista)

I haven't given the Buffy page any thought yet; sorry. smiley - blush

I did, however think you might appreciate this - it's rather wonderful!

http://csszengarden.com


Back ground

Post 10

Calculator Nerd 256

here's ur script that does that

var backgroundOffset = 0;
var bgObject = eval('document.body');
function scrollBG(maxSize) {
backgroundOffset = backgroundOffset + 1;
if (backgroundOffset > maxSize) backgroundOffset = 0;
bgObject.style.backgroundPosition = "0 " + backgroundOffset;
}
var ScrollTimer = window.setInterval("scrollBG(307)", 64);


some tiny improvements:

var backgroundOffset = 0;
var bgObject = document.body; //not sure if that will work the way i have it, but it's worth a shot
function scrollBG(maxSize) {
setTimeout("scrollBG(307)", 64); //moved to the front because errors would have stopped it at the end, changed to a timeout because it is recursive
backgroundOffset++; //easier to read and equivalent
backgroundOffset %= maxSize; // cleaner, no "if()", and even prevents jumping (perhaps)
bgObject.style.backgroundPosition = "0 " + backgroundOffset;
}

hope that helps!
smiley - geek>8^B


Back ground

Post 11

Loup Dargent

Great... smiley - cheers

I will definitely try it later on after I had some sleep...smiley - bubbly

Great timing as well, as the idea behind the page is now being adapted for a forthcoming collaborative project which [hopefully] will involve people from h2g2 and Talk Buffy...smiley - disco

Talk soon and thanks again...smiley - smiley

smiley - surfer

loupsmiley - fullmoon


Back ground

Post 12

Loup Dargent

Oooops... I missed post #9 when it was posted...smiley - sorry

I will have a look asap...smiley - smiley

smiley - surfer

loupsmiley - fullmoon


Back ground

Post 13

Loup Dargent

Calculator Nerd 256... I tried it and nothing happened...smiley - wah

The background didn't scroll anymore...smiley - yikes

loupsmiley - fullmoon


Key: Complain about this post

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more