Old 07-13-2004   #1 (permalink)
Registered User
 
GoldNetX's Avatar
 

Join Date: Nov 2003
Location: Pittsburgh, PA
Posts: 294
Images: 5

Send a message via AIM to GoldNetX
Loading Order

I've got my centering problem almost figured out, but now a new one arises.

After some testing it seems that the last thing to load in the browser is javascript. This creates a problem because the page uses javascript to calculate the center and reposition itself. My question is if anyone knows a work around for this, or someway to alter the load order of the webpage.

Thanks for any help.
__________________

www.gusmayo.com
- Maybe a story or two -


www.jaloobie.com
... your new home ...

www.webinkproductions.com
- professional web application design -
GoldNetX is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-13-2004   #2 (permalink)
Registered User
 
Frank Jaeger's Avatar
 

Join Date: Oct 2003
Location: Illinois
Posts: 107

Send a message via AIM to Frank Jaeger Send a message via MSN to Frank Jaeger
There's no need to use any javascript. The easiest solution to this would be to create a class as follows:

Code:
.EDIT { margin: 0px auto 0px auto; width: EDIT; }
What you do would be to to edit the value shown to match your needs. Figure out your largest width value and insert it into the above class. Make sure to take any padding or margins into consideration. Then do something along these lines:

Code:
<body>

<div class="EDIT">

CONTENT

</div>

</body>
That should solve all your problems of centering.
__________________
I am not original.
Frank Jaeger is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-13-2004   #3 (permalink)
Registered User
 
Order's Avatar
 

Join Date: Oct 2003
Location: San Diego, CA, USA
Posts: 2,254
Images: 2

Send a message via AIM to Order Send a message via MSN to Order Send a message via Yahoo to Order
I find Javascript to be a blocky, bloating feature, it can be lean and mean, but why use it to figure out widths and heights, when you can focus on set widths and heights.

When designing a page, focus on it fitting in a 800x600 window, the 600 can be larger, since it is height, but no wider then 800 at its most.
__________________
Order is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-13-2004   #4 (permalink)
Registered User
 
GoldNetX's Avatar
 

Join Date: Nov 2003
Location: Pittsburgh, PA
Posts: 294
Images: 5

Send a message via AIM to GoldNetX
I tried what you said at first Jaeger, but the problem is that only some of my pages have vertical scrollbars, and the page slightly jumps to the new center when the user goes to a pages with a vertical scrollbar.

I was using javascript combined with css to find a center value based on the viewers resolution and use absolute coordinates to set it to the center.

I've tried using the overflow : scroll css thing but that isn't compatible with browsers, other than IE, and I have yet to find a way to correctly keep vertical scrollbars always on in other browsers.

As a side question, is there anyway to pass javascript values to php or pass php values to css?
__________________

www.gusmayo.com
- Maybe a story or two -


www.jaloobie.com
... your new home ...

www.webinkproductions.com
- professional web application design -
GoldNetX is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-13-2004   #5 (permalink)
Registered User
 
Order's Avatar
 

Join Date: Oct 2003
Location: San Diego, CA, USA
Posts: 2,254
Images: 2

Send a message via AIM to Order Send a message via MSN to Order Send a message via Yahoo to Order
PHP values to CSS would be simple enough, keep your css in your documents (not in a seperate .css file, then you can place variables like so in your css:

Code:
.class {width: <?= $phpvar; ?>;...}
That is untested, but may work.. :\
Order is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-13-2004   #6 (permalink)
Registered User
 
GoldNetX's Avatar
 

Join Date: Nov 2003
Location: Pittsburgh, PA
Posts: 294
Images: 5

Send a message via AIM to GoldNetX
Alright, I got a solution to the problem. I now use my Gateway/Entrance page to calculate the horizontal offset via javascript, which then writes a link to my main page passing the value through the url. PHP then grabs the value and puts it into the css before anything is loaded, so it is always centered; this value is then passed through each url to maintain the center position.

Also using a check in the begining to see if the x offset is set, if not it re-directs back to the Gateway/Entrance.

Just incase anyone was wondering.
__________________

www.gusmayo.com
- Maybe a story or two -


www.jaloobie.com
... your new home ...

www.webinkproductions.com
- professional web application design -
GoldNetX is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-14-2004   #7 (permalink)
Registered User
 
Order's Avatar
 

Join Date: Oct 2003
Location: San Diego, CA, USA
Posts: 2,254
Images: 2

Send a message via AIM to Order Send a message via MSN to Order Send a message via Yahoo to Order
sounds quite over-complicated, but whatever floats your boat.. *shrugs*
__________________
Order is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
i suppose introductions are in order ... treyger Introductions 832 08-10-2009 06:13 AM
PHP Arrays, Is it possible to order information in an array alphabeticly? basicwe HTML / PHP / ASP / JS 2 06-25-2007 12:25 AM
Loading WickedLady Flash & Dynamic Media 14 02-16-2005 10:45 AM
The Order Has Landed Order General Discussions 6 07-18-2004 06:27 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT