I'm working on this RPG thing, and even with setting the body height/width to 100% and overflow hidden, it scrolls with the arrow keys. So my current tactic is to have an input field and basically select it all the time, but eventually I want chat in-game, although I could force input on that and just have 'continual' chat as it were.
It'd be much 'neater' to disable the scrolling direct with javascript, but google has turned up nothing, and I'm only really learning javascript as I build the 'engine' anyway.
Thanks!
What if you just did an absolute div that lies on top of everything?
[code]
#container{
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
}
[/code]
[QUOTE=andersonmat;19735178]What if you just did an absolute div that lies on top of everything?
[code]
#container{
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
}
[/code][/QUOTE]
Don't see how that would work? (tried, didn't)
Problem is, the map div NEEDS to be larger than the screen, so needs to overflow. Originally I was just using a background image, but I need to have links/etc within the map for characters and moving map etc.
Ah, well I assumed it didn't have to be larger than the screen. :v:
I'll think of something.
[QUOTE=andersonmat;19735799]Ah, well I assumed it didn't have to be larger than the screen. :v:
[/quote]
Yeah I was all pleased with background images till I realized how I have no realistic other way to put stuff 'on' maps.
[QUOTE=andersonmat;19735799]I'll think of something.[/QUOTE]
Thanks!
Here's some pseudo code
[code]
onkeypress (ev):
if key is left or right or up or down:
ev.preventDefault();
[/code]
They need to make an actual psuedo coding language.
[QUOTE=Wipmuck;19740356]They need to make an actual psuedo coding language.[/QUOTE]
I'm sure someone's done it.
[QUOTE=andersonmat;19740400]I'm sure someone's done it.[/QUOTE]
Now would be appropriate for 'DO WANT'.
[QUOTE=Vampired;19739597]Here's some pseudo code
[code]
onkeypress (ev):
if key is left or right or up or down:
ev.preventDefault();
[/code][/QUOTE]
Aye, ev.preventDefault(); and if for some reason a browser doesn't implement that function, you can stick 'return false' at the end of your onKeyPress function, which should do the same thing.
Sorry, you need to Log In to post a reply to this thread.