A Conversation for The H2G2 Programmers' Corner
Webbrowser Problems,
DoctorMO (Keeper of the Computer, Guru, Community Artist) Started conversation Oct 28, 2002
A JavaScript/CSS Problem here,
I've made a menu system, to get it to work in NS6 and IE5.0 I had to do quite a lot of jiggery pokery, none of the versions had the same seting and getting for positioning of elements, let alone the getting of the objects them selves (this problem was solved with the replacing of getElementById with some if's for layers and all) now I've come to the conclusion that either I'm going to have to saunter down the HTML tree untill I reach the root or display everything at the top left of the screen. is there no way to ask it for true dimentions?
using DIV tags, with CSS styles.
Webbrowser Problems,
Pastey Posted Oct 28, 2002
Off the top of my head, you use a javascript function to get the screen size, this has to take account of the different browsers, and then assign the values to variables, x and y, you then use these.
CSS can also set them selves from the bottom right aswell.
Webbrowser Problems,
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 28, 2002
Why would I need the screen area or scroll area?
-- DoctorMO --
Webbrowser Problems,
Pastey Posted Oct 28, 2002
Have you got this up anywhere?
getting the screen/window size allows you to place exactly per pixel the elements on the page.
if you want it fluid, use percentages.
Webbrowser Problems,
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 28, 2002
I did have a problem setting the positions but I seem to solve that with some research into the way they behave, it's getting the damb current values without setting any (because of text flow).
http://www.infranet-partners.com/cgi-bin/index.pm
give me a min, to upload the latest version.
-- DoctorMO --
Webbrowser Problems,
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 28, 2002
That should do it.
-- DoctorMO --
Webbrowser Problems,
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 29, 2002
it's fudged at the moment, I got a load of if NS +10px and if else -5px, it's just not right and then I got a realy sticky table traverse for one of the dimentions in were I go though it with Id's, I can't use these because there not apart of the script and it makes it realy inflexable!
-- DoctorMO --
Webbrowser Problems,
Pastey Posted Oct 29, 2002
Instead of using px to set exact pixels, why not try % to give it a percentage? Flows easier that way.
Failing that what about the..
style="position:absolute; top:10px left:10px"
attribute. Of course, you can use your own figures
Webbrowser Problems,
C Hawke Posted Oct 29, 2002
Not sure if this helps in anyway, but the JS routine that MM Fireworks uses (copyright free, see notes at top) to do menus can be found on my site here [Unsuitable link removed by Moderator]- any of the html pages on my site show how it is invoked.
CH
Webbrowser Problems,
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 29, 2002
see, perfect way to SET position, but when it comes to GETing the position JavaScript's DOM falls to it's nees. Oh dear why did we have to move from simple Assembler?
-- DoctorMO --
Key: Complain about this post
Webbrowser Problems,
- 1: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 28, 2002)
- 2: Pastey (Oct 28, 2002)
- 3: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 28, 2002)
- 4: Pastey (Oct 28, 2002)
- 5: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 28, 2002)
- 6: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 28, 2002)
- 7: Pastey (Oct 28, 2002)
- 8: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 29, 2002)
- 9: Pastey (Oct 29, 2002)
- 10: C Hawke (Oct 29, 2002)
- 11: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 29, 2002)
More Conversations for The H2G2 Programmers' Corner
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."