PDA

View Full Version : Two Javascript codes needed.



Simie
06-15-2006, 06:28 PM
I need a code that will keep certain bits of html at the VERY bottom of the page, even if the viewer scrolls down. Kinda like the windows xp menu bar.

I also need a script that can drag pictures around the screen but when you drag it it doesn't click the link they go to, you have to double click to go to that link.

Thanks alot :)

If you need any more info just ask

~Simie

Simie
06-16-2006, 01:41 PM
bump

Can anyone do this?

Simie
06-17-2006, 04:27 PM
Bump
I really need this :(

djr33
06-17-2006, 08:37 PM
If you absolutely need it at the bottom of the screen, then why not just use a frame? Make it a few pixels high, let the rest of it scroll.... yeah.
Or you could use a <div> to hold everything else above it, and set that so that so you have it scrolling if it's bigger than the space given. (Do divs even work with height settings? Haven't tried that much, but I think it might not work well. Or maybe use a table or something if that fails.) Then just put whatever you want after the </div> tag, and that would stay at the bottom, or at least after the scrolling div... you'd just need to be sure to set the heights corrently.
(probably use pixels for the bottom and percent for the upper one. Or, rather, set the whole thing to 100% somehow, then set the bottom to pixels, and the upper part would fill the remaining space. ...should work, anyway. Might be complex to set up like that, though.)

You can also use layers, but that would cause it to overlap with the content under it.
For example:
<div style="z-index:1">put your stuff here, bottom align it in a table, div, or something, and put the rest of the content as you would normally on a page. the z index... height will put this on top of the rest. I think that 1 means above... but you might want 2... haven't done that in a while.</div>


As for the dragging thing, look at the scripts here, find one that does what you want:
then.. remove the stuff you don't like, such as the code that makes it clickable, or whatever.
but, since you want it to work on double click, just replace onClick with onDblClick. look that up to be sure it's right, but I think I saw that yesterday when I was looking for something else.

Hope this helps.

Simie
06-17-2006, 08:40 PM
Thanks alot :) I'll be testing some of these ideas.

Thanks :)

~Simie

djr33
06-17-2006, 08:43 PM
Sure.

Also, a much more complex way to code the first thing (though maybe a better result in the end) would be to code javascript that dynamically positions something at the bottom. But that would of course be hard, and come with it's own set of problems.

Also, i just realized... for the layer thing, you coul have the content below it without an issue. Just give the upper layer (for the part on which there is content) a background, and that should cover content below it.

Be sure to give enough white space at the bottom of your underneath page so that there isn't any content permanently hidden under the top layer.


...and, the more I think about it, this might not work. It would work at the start, but once you scroll, the top layer would likely scroll with the bottom one. Don't know if there's a way around that or not.

Twey
06-17-2006, 09:51 PM
You can also use layers, but that would cause it to overlap with the content under it.Layers are obsolete, and should never be used.

djr33
06-18-2006, 10:09 AM
So... frames, then, Twey?

Or tables/divs?

Twey
06-18-2006, 10:25 AM
Divs are the best option here.
The <layer> tag went out with Netscape 4 or something, didn't it? Before I got into web design, anyway.

djr33
06-18-2006, 10:27 AM
Well... I didn't mean the layer tag, but using divs on top of one another... layers of divs.