Click to See Complete Forum and Search --> : Moving Page?


Zibings
12-09-2003, 11:44 AM
While attempting to put a JavaScript tree-menu onto a page currently under construction, encountered a problem where the centered table that encloses the main content of the site literally moves to the left after clicking on a link.

In other words, when the page is first loaded, everything comes out fine and dandy. However, when clicking on the "Home" link in the menu, upon reload, the middle of the page has moved closer to the left side of the page, causing the menu to look off-center, and just overall bad. If anyone has any suggestions as to how this can be fixed besides possibly sending extra headers through PHP, please let me know ASAP!

Info:

The Site In Question (http://www.zibings.com/zr)
My Email (webmaster@zibings.com)

giggledesign
12-09-2003, 01:26 PM
the problem is in the JavaScript, i think you should try this message on the JavaScript board. I will check the html though just to be sure

Zibings
12-09-2003, 01:30 PM
In the JavaScript? I'm not quite sure I can see where that would be happening. The JavaScript would not be changing the center of the page. Also, a little crude science here, but if you put a pencil on the left edge of the page, then click on a link and let it reload, you'll notice that the page changes it's middle, not the JavaScript.

giggledesign
12-09-2003, 01:32 PM
could i ask where you got the script from?

Zibings
12-09-2003, 01:34 PM
Um...sure. Let me go find the copyrights. I honestly don't think it's the JavaScript though. Pull out your pencil and test it!

Zibings
12-09-2003, 01:38 PM
Here's the copyright tag. Found it on another website though:

http://www.lib.berkeley.edu/doemoff/


/***********************************************
*(c) Ger Versluis 2000 version 9.10 14 October 2002 *
*You may use this script on non commercial sites *
*www.burmees.nl/menu *
*You may remove all comments for faster loading *
************************************************/

giggledesign
12-09-2003, 01:53 PM
maybe if you removed the <center></center> tags from you HTML?

Zibings
12-09-2003, 01:57 PM
The center tags are there to center the main content area. Taking out the center would just shove everything to the left side of the screen, which would make it appear odd on higher resolutions.

giggledesign
12-09-2003, 01:59 PM
ah, so you are using include() php ah right ok hmmm

Zibings
12-10-2003, 09:28 AM
Just in case you wanted some proof that this is happening, I took some screenshots of it "inaction":

http://www.zibings.com/zr/fresh.jpg
http://www.zibings.com/zr/linkthrough.jpg

The first is a shot of when you first load the page (or refresh a page on the site). The second is what happens after clicking a link on the site and it goes to a new page (without refresh).

I'm using IE 6+ on WinXP Home.

Zibings
12-10-2003, 04:41 PM
Well, this has certainly been one of the weirdest errors I've seen in my years as a coder, HTML or not. I had to set the body leftmargin tag to 9 in order to fix the error, and it seems to be working across most browsers. Thanks for your help folks!

Paul Jr
12-10-2003, 04:49 PM
Just as a thought, I checked your site out in Moz with JS turned off. I got this where the menu was supposed to be:

Your browser does not support script

I hope you're going to provide an alternate form of navigation for those of us who are not able to have JS enabled, or just disable it by choice.

Also, I would suggest converting to a CSS based layout.
Talk to Vladdy, he's got a bit of code that'll allow you to achieve that "box" effect via styling the <html> and <body> tags.

Zibings
12-10-2003, 05:12 PM
Yes, that is a placeholder until we finish the alternate navigation. The site is still under construction keep in mind. ;)

In regards to the CSS layout...

Let me put it this way, most people would call me "old school". I still stand by the belief that w3 standards are bothersome and I will refuse to do them until I am forced to do so. Thank you for the advice, but, until then, I'll go on my happy, stubborn ways. ;) No offense.

Paul Jr
12-10-2003, 05:30 PM
Originally posted by Zibings
I still stand by the belief that w3 standards are bothersome and I will refuse to do them until I am forced to do so.

On another forum, I ran into a post where someone said that hand coding in Notepad is pointless, and not a good idea. I told him he must've made a typo, as hand coding is Notepad is one of the best ways to build a website.

I believe you have also made a typo. I don't see how you can think the W3C's standards are bothersome. It's just not plausible to me. At the very least, it's easier to build a website while following their standards. I find it easier to use CSS then to type the damn (sorry 'bout swearing) <font> and <table> and <tr> and <td> tags over and over and over. I used to think CSS wasn't that great a while ago, but that was when I didn't know any CSS. I would never, ever, ever think of going back to my tables and <font> tags now that I know CSS. I cannot believe that anyone would think that using CSS is a bad idea. I mean c'mon, people! It's just plain easier! There is no other way to put it!

If you haven't tried CSS, try it. I want you to tell me, honestly, after learning as much CSS as you can, that it's bothersome, and you'd rather go back to your tables and <font> tags. If you did, you're either really, really stubborn, or you didn't dig deep enough! CSS is almost limitless! Check out www.csszengarden.com You won't find a site like that one that uses tables and depreciated tags.

Zibings
12-10-2003, 05:38 PM
Check out www.csszengarden.com You won't find a site like that one that uses tables and depreciated tags.

You know...you're right. Pages that use "deprecated" tags actually work! J/k!

In all seriousness, I've been coding HTML for something like 7 or 8 years, and along with that, I've used CSS for something like 4 or 5 years. I know how extensive CSS can be, and I still will tell you I honestly think it's bothersome to follow somone else's standards. I like coding my PHP with <tr>'s and <td>'s, not sure why, but I love it, and some of my sites aren't that bad to be honest. I will check out that site though, and I will probably tell you that it's overdone and that I could find a way to do it with <tr>'s and <td>'s, but you don't HAVE to believe me. ;) It is most likely just personal preference. :p

Zibings
12-10-2003, 05:42 PM
Ah there, the site is up again. And...as promised...it is a bit overdone. But, the reason I say that is I don't like things popping over my text. Also, I viewed the source for the page...and I must say, it is well done. All things considered though...I could probably make some dirty dirty hacks and get a site to at least resemble that one greatly.

Again, all personal preference.

Paul Jr
12-10-2003, 05:56 PM
From: source code of "This Is Cereal" design
This xhtml document is marked up to provide the designer
with the maximum possible flexibility. There are more classes
and extraneous tags than needed, and in a real world
situation, it's more likely that it would be much leaner.
However, I think we can all agree that even given that, we're
still better off than if this had been built with tables.


You might say it's overdone, and it just might be, but you show me a site like that one that uses tables and depreciated tags, and I'll give up web design. It is near, if not absolutely, impossible to create a site like www.csszengarden.com Only the CSS is changed to create those different designs, the XHTML markup is *Not* touched. Can you do that with a table-based layout? I hardly think so.

Zibings
12-10-2003, 06:22 PM
Challenge accepted. When my designer and I finish up on the few sites we're tackling right now, we're going to set up a site that looks very similar, and we won't use CSS (at least, not with XHTML and the way it's been used there). We'll find a way, but if somehow we don't, I'll turn to the W3C standards, at least for HTML and CSS. Deal?

Paul Jr
12-10-2003, 06:37 PM
Originally posted by Zibings
Challenge accepted. When my designer and I finish up on the few sites we're tackling right now, we're going to set up a site that looks very similar, and we won't use CSS (at least, not with XHTML and the way it's been used there). We'll find a way, but if somehow we don't, I'll turn to the W3C standards, at least for HTML and CSS. Deal?

If you don't use CSS, how do you expect to achieve different designs without changing the (X)HTML markup?

Zibings
12-10-2003, 06:46 PM
I said we wouldn't use CSS or XHTML the way they are used on that page. To be honest, you won't see a bit of XHTML in the page that we make, we stray away from it totally.

We'll use CSS, and, as far as allowing those different designs...why not just use a PHP template for that? It's the same thing, either way you're just changing the way the page is laid out, and I can do it with a simple PHP template system and use about 30% less coding.

Make a little more sense?

Paul Jr
12-10-2003, 06:52 PM
You misunderstand me. What I meant was for you to create a site that not only looks like www.csszengarden.com, but also functions like it as well. That means being able to totally change the design of the site without editing any of the (X)HTML markup.

Zibings
12-10-2003, 07:02 PM
I suppose I did misunderstand you. Well, in that case, there's no point. Again, this goes back to my argument that using all that overhead with CSS and XHTML is not necessary. We can make a site like that which is just as easy to make designs for, provided, of course, that the designer knows the "old" way to do a site. ;) If you're interested in seeing that, let me know. Otherwise, it kinda goes against what I stand for.

Paul Jr
12-10-2003, 07:15 PM
Originally posted by Zibings
all that overhead with CSS and XHTML is not necessary.

I really don't see how using CSS and XHTML to create fluid, accessible, aesthecially pleasing, easy-to-read code, easily editable, standards compliant, functional websites is "overhead."



***EDIT***

www.aspfreeserver.com/pauljr/tests/buttonize.html
Can you do that with tables and depreciated tags? Without JavaScript? Without images?
Since the other thing is out of the picture, try this.

I want to see what happens, and I also want to see your code, if you do it.

Zibings
12-10-2003, 08:01 PM
Hmm...now in this situation, you have me in a teensy bit of a bind. Though, I don't see the advantage in being able to do something of this sort, the only way I could do it without JavaScript is to do a pure PHP page, that draws dynamic images using the GD library (or an equivalent). Not a hard thing, but TECHNICALLY those are images, and therefore would go against your desired result. However, this would be one situation where I would have to use CSS and JavaScript to reach the desired result.

At the same time, I'd like to point out that this is like me asking you to construct a fully-functional and secure forum using only (X)HTML, JavaScript, and CSS. You tell me if that's really something that would be fair to ask. This is something that is very specific to CSS/XHTML, and as I stated, serves no real purpose in my mind. Were you to make it look marginally "professional" you'd have to create a background image, and at that point, you might as well just create two button images and do some simple CSS to do the same exact thing.

Paul Jr
12-10-2003, 08:12 PM
I had whipped that up for another reason, and thought it would be a good example.

The point is, CSS can do alot of things that tables and depreciated tags can't. There was no real reason, 'cept to prove my point.


At the same time, I'd like to point out that this is like me asking you to construct a fully-functional and secure forum using only (X)HTML, JavaScript, and CSS


Exactly. It's impossible to create an fully-functional and secure forum using only (X)HTML, JavaScript, and CSS. Likewise, it's impossible to create Pure CSS "Buttons" like these (http://www.aspfreeserver.com/pauljr/tests/buttonize.html) using only HTML (with depreciated tags mind you).

Also, I really don't think this compares as well you might think. I asked you to create buttons like I had using your method, I never said you couldn't use CSS, you said it for me by saying you didn't want to. Asking me to create a fully-functional and secure forum with only (X)HTML, JavaScript, and CSS is like me asking you to create buttons like I had without using CSS. I never said you couldn't, you just said you didn't want to.

Zibings
12-10-2003, 08:14 PM
Yeah, I think you may have misunderstood ME. I was against the standards more than anything else. I understand where CSS and it's uses are, as well as XHTML (remember the 5 or so years?). I just prefer to use them very very lightly, XHTML in particular.

Paul Jr
12-10-2003, 08:17 PM
If you have used CSS and XHTML for as long as you say, how can you, after knowing the advantages of using it, try to use it as little as possible? I just don't get it... either you didn't learn much of anything, or you're the oddest Web Designer I've ever seen.

Zibings
12-10-2003, 08:22 PM
I'd go with the oddest web designer bud. ;) My company exists simply to break the norms of the corporate world, and web services is just one subsidy that is being used to demonstrate how well the philosophy will work.

It's great...I don't have enough jobs for people...and I believe in not following the direction of everyone else. I've found ways to do everything else I ever needed to using HTML and minimal JavaScript and/or CSS. It's just...how I am.

Paul Jr
12-10-2003, 08:26 PM
Mmm... yeah, I'd have to go with the oddest, too. :D

pyro
12-10-2003, 09:13 PM
Somebody needs to read "designing with web standards" by Jeffrey Zeldman, me thinks... ;)

Paul Jr
12-10-2003, 09:27 PM
Originally posted by pyro
Somebody needs to read "designing with web standards" by Jeffrey Zeldman, me thinks... ;)

Ooo, I so want that book! I asked for it for christmas. If I don't get it, then I'll just buy it myself.

pyro
12-10-2003, 09:30 PM
It's worth it's weight in gold. Pay special attention to the sections that talk about semantic (X)HTML, as that is a concept that most web authors do not seem to grasp.

Zibings
12-10-2003, 09:38 PM
Hey now, I use my own standards thank you very much. They work great within my company.

pyro
12-10-2003, 09:44 PM
Your own standars? Perhaps you are writing your own DTD for XHTML -- but I doubt it...

Zibings
12-10-2003, 09:52 PM
Please read above, I don't use XHTML.

pyro
12-10-2003, 09:53 PM
Then what standard might you be talking about?

Zibings
12-10-2003, 09:54 PM
It was a joke Pyro.

pyro
12-10-2003, 09:57 PM
I realize that. Twas just trying to point out that it was actually a non-standard. ;)

Zibings
12-10-2003, 09:57 PM
Well, at least I didn't say I used KISS Standards. ;)

pyro
12-10-2003, 09:59 PM
lol :p

Zibings
12-10-2003, 10:01 PM
To be 100% honest, I do have my own set of things for everything from formatting to the way you design a page. I also have a template system that does most of the work for me (hand-made), and...well...works as well as any CSS/XHTML combination I've ever seen, except you have to change the markup language to get a different "skin". Again, I don't see a problem with this since the template system makes it horrifically easy.

Paul Jr
12-10-2003, 11:50 PM
PAH!

Zibings
12-10-2003, 11:52 PM
???

Paul Jr
12-10-2003, 11:57 PM
I'm... not really sure, I...uh, just thought it was a "Pah" moment...

Zibings
12-11-2003, 12:01 AM
Well...since you and I seemed to be on a roll today...would you like to discuss the advantages of using Peh! over Pah!??

Paul Jr
12-11-2003, 12:16 AM
Pyro may not like our spamming... :(

Zibings
12-11-2003, 12:18 AM
Eh...good point. Oh well! Maybe we could convince everyone that PEH and PAH should be new XHTML DTD's!

Paul Jr
12-11-2003, 12:32 AM
Noooooooo!!! I like my XHTML 1.1 DTD!