0
   

No Scroll on Firefox?

 
 
Muarck
 
Reply Mon 28 Sep, 2009 09:10 am
Is there Firefox equivalent to <body scroll="no" ...

I really need to prevent a screen I'm working on from scrolling.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 3,492 • Replies: 11
No top replies

 
engineer
 
  1  
Reply Mon 28 Sep, 2009 09:16 am
@Muarck,
I thought FF was completely compliant with the HTML standard. If you can find it in the standard, it should work in FF. In not sure if this is the most current standard http://www.w3.org/TR/html401/
engineer
 
  1  
Reply Mon 28 Sep, 2009 09:45 am
@engineer,
I tried this code and it worked
Code:<html>
<body>
<STYLE type="text/css">
BODY { overflow: hidden;}
</STYLE>
...
</body>
</html>
Muarck
 
  1  
Reply Mon 28 Sep, 2009 09:57 am
@engineer,
Rats!
Still having trouble.
I can get the scroll bars to disappear, but even with your new line of code I can still scroll the screen using the arrow keys up and down. Problem is I'm making a web-based video game and the arrow keys are for moving the character having them move the screen at the same time is really annoying!
engineer
 
  1  
Reply Mon 28 Sep, 2009 10:08 am
@Muarck,
I think you need a javascript event handler so that if the arrow keys are pressed, the action you want initiates instead of the default action. I saw several examples on the net, but I can't vouch for any of them.
Robert Gentel
 
  1  
Reply Mon 28 Sep, 2009 10:39 am
@engineer,
And he can also use javascript to capture the viewport and size the page accordingly so that there is no scroll.

Another way to do it is to skip liquid dimensions altogether and go with a static size. Many games use a popup window at a specific size for this reason.
Muarck
 
  1  
Reply Mon 28 Sep, 2009 11:18 am
@engineer,
Quote:
I think you need a javascript event handler so that if the arrow keys are pressed, the action you want initiates instead of the default action. I saw several examples on the net, but I can't vouch for any of them.


I am using:

Code:onKeyDown="keyIn(event);" onKeyUp="keyOut(event);"


To control the motions of the character and that works great for controlling the character. The problem is the screen also scrolls.

You think there's a way to prevent the browser window from receiving these events as well?
Muarck
 
  1  
Reply Mon 28 Sep, 2009 11:19 am
@Robert Gentel,
I can't fit the screen to the size of the game area because I want the game to play in fullscreen and if a graphic is half on and half off the screen then I'm screwed. Although in the right game that would have been a great idea.
0 Replies
 
Robert Gentel
 
  1  
Reply Mon 28 Sep, 2009 11:22 am
@Muarck,
You may want to try using the scrollBy method to control the scrolling. See here:

http://www.w3schools.com/htmldom/met_win_scrollby.asp
Muarck
 
  1  
Reply Mon 28 Sep, 2009 04:14 pm
@Robert Gentel,
Rats! Another good idea, but unfortunately, this only works if the scrolls bars are visible. And I really don't want scrolls in my game window.
engineer
 
  2  
Reply Mon 28 Sep, 2009 05:40 pm
@Muarck,
Try the code at the bottom of this thread. I tried it and it works for FF, but not for IE.
0 Replies
 
Muarck
 
  1  
Reply Tue 29 Sep, 2009 09:29 am
@engineer,
This was perfect for me because I already have it not scrolling in IE and now that FireFox works I've got it working on both!

Thank you so much!
0 Replies
 
 

Related Topics

YouTube Is Doomed - Discussion by Shapeless
So I just joined Facebook.... - Discussion by DrewDad
Internet disinformation overload - Discussion by rosborne979
Participatory Democracy Online - Discussion by wandeljw
OpenDNS and net neutrality - Question by Butrflynet
Internet Explorer 8? - Question by Pitter
 
  1. Forums
  2. » No Scroll on Firefox?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/10/2024 at 07:52:56