Help - Search - Members - Calendar
Full Version: Does Anyone Know How To...
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > JavaScript
tomlkier
...emulate the banner effect on dafont.com

it stays where it is until you scroll down so you can see all of it, then if you scroll lower than that it sticks to the screen in a fixed position.

it's similar to this script i found

http://www.dynamicdrive.com/dynamicindex17/dockcontent.htm

but that one glitches when you scroll (in ie atleast)

any help would be appreciated, i am a javascript noob sad.gif
Andrew
It could be done with javascript, but I don't know anything about it to be able to determine if it is or not, but I know that i've seen on blogs before where they have a sidemenu and it does the same thing as the ad on dafont, and they did it with css.

And also it doesn't work in firefox (the dafont ad thing) the css version worked on firefox just fine.
tomlkier
can you link me to a site that uses the css method plz
Ed
The css way is to use position 'fixed' but there's a caveat with this method and that is that it is not cross browser compatible (IE6 for instance doesn't support it)

Try this is in firefox
CODE
#mydiv
{
   top: 0;
   left: 0;
   position: fixed;
}


There's some solutions for IE6 (7 does support fixed), see here:
http://www.cssplay.co.uk/layouts/fixed.html
tomlkier
i am aware of position: fixed, but that will always stay relative to the browser screen whereas the effect on dafont allows you to scroll down before it becomes fixed if you see what im trying to say :S
Andrew
Here you go man, it's actually similar to what bread posted, but does EXACTLY what you want. It even has an example on the right so you can test it out. Although even this doesn't work on IE6 (I didn't read the whole thing, so there may be a fix)
But check out this link. This was actually the original link I was thinking of when I posted earlier, just was too lazy to google it.

http://www.derekallard.com/blog/post/condi...sticky-sidebar/
tomlkier
thanks for the help guys smile.gif
Andrew
Hate to bring up an old topic, but I was wondering what you ever did with this?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.