Click to See Complete Forum and Search --> : layer, div, visibility, and other great things...


Ness_du_Frat
01-22-2005, 02:43 PM
Hi !!!
First thing, as I'm going to start a LONG explanation, which will certainly be very confuse, you'll have to be especially patient ;)
Thanks for checking my topic...

Ok, let's start...
I have a very VAGUE idea about how layers work, and that's my problem. I had in mind that you could change the visibility of layers, but after trying, I realised that it wasn't so simple.
I'm creating a new design for my website, and I wanted to have some sort of a menu, but which would change according to which section was chosen.
I know this must seem very confuse, and I'll try to do my best to explain what I want exactly.
I have, let's say 5 sections, and to each section corresponds 4 to 6 subsections.
The subsections are in a table, and to each cell corresponds a well-defined background. I want to keep the background and the disposition of the table, but to diminish the number of the cells. If the section has only 4 subsections, I don't want the 2 last cells.
Then, I want to add text ( and particularly limks ) to the cells. Of course, this text and the link corresponding to it will change according to which section is being viewed...
I'm getting crazy with this. It's the first time I work with layers, I'm not even sure it's the way to go...
My problem is to get the table showing the right text when a section is clicked.
I had the idea of putting different layers, and changing their visibility with a javascript function, but... I know so little about layers, I wasn't even able to have a simple one show. ( it showed, but not the background... )
I'm aware this is not an easy problem, but I'll be really glad to have a little help !!!!
Thanks a lot !!!
Ness

Ness_du_Frat
01-22-2005, 03:07 PM
after thinking a bit more about it, I wonder if it's possible to use only div and no layer at all ? I read layer was not a valid html tag, and... yeah, if I can avoid using strange things, it will even better.
I thought...
If I make all the section menus
<div id=1><table>blablaimagelinks</table></div>
<div id=2><table>blablaimagelinks</table></div>
<div id=3><table>blablaimagelinks</table></div>
....
and then I use a javascript script to show them or hide them ?
The problem is, won't it take forever to load ?
I would prefer a solution were the table could stay, and only the links would change, as well as the text. I like to learn new things, and I was interested in doing it that way, so if you have a solution going in this direction, it would be great !

PeOfEo
01-22-2005, 04:05 PM
What you want to do should not be done with javascript. This will create an accessibility problem. If you allowed the content to scroll within the block element containing the background would that work? The other option is to swap out the content with a server side language.

Ness_du_Frat
01-22-2005, 05:23 PM
I don't really understand your first solution...
I could use php to do that, but i know nothing about php, but it's on my long list of the things I have to learn XD
Javascript is an accessibility problem, yes, but I'm not really talking about a HUGE website with THOUSANDS of visitors daily... It's more the kind of calm website, updated monthly, and the visitors are mostly people I know, so... lol !!!
But, yeah, I'd like to use your first solution, if you could explain it a bit better...

MstrBob
01-22-2005, 06:20 PM
What ever happened to normal pages? Let me see, if I understand you correctly, you have different sections of text, right? And depending on what link is clicked, you want the menu and text to change, but not actually go to a new page. Am I correct in this? If so, read on, else correct me.

What would come to mind for me is Javascript. Now within this there are two methods off the top of my head. One would to have all of your text on the page. And then, using Javascript, toggle the visibility of the blocks of text. This would work, however there are two issues. One, there would be a considerable page load, depending on the amount of total text in addition to being a nightmare of a page for users who disable Javascript, and an SEO nightmare. Second, you would loose the ability to bookmark specific pages.

Another method could be a server-side/Javascript combo. In this scenario, each link calls a JS function which actually calls a server-side page that returns the appropriate text via a request and actually replaces the content with the new content. This would cut load times since visitors would only be loading the content. However, you once again loose bookmark functionality.

Why not just embrace CSS and have standard pages. At the end of the day, they're the most successful.

Ness_du_Frat
01-22-2005, 06:40 PM
Yeah, I know I should make something simple, but I was bored this afternoon and I decided to do that...
The amount of text is not THAT huge. I mean, it won't be more than 6 subsections for each, and each subsection is only one word long.
A friend said I had better to do it in Flash. Moreover, I could make some animations. He is forgetting to things : I don't make my website in Flash because some people don't have the flash player and aren^'t looking forward to having it, and second, I know absolutely nothing in flash... lol !!!
I know nothing in php either...
I think I'll have to stick to javascript !!!
it's really a nitemare. I mean, I try to do that, and the more I learn, the more difficult it becomes... I see now that what I want to do is really HUGE and difficult, what I hadn't expected in the beginning... I'm really lost... T__T

PeOfEo
01-22-2005, 06:44 PM
Originally posted by MstrBob


Why not just embrace CSS and have standard pages. At the end of the day, they're the most successful. I agree

To explain my first solution better Ness_du_Frat. I meant you can have a block level element that has scroll bars on it. The element will retain it's size, if the client does not support css the content will all be accessible still. You can have links to different parts of the document neat the top of the block level element. This will look similar to an iframe, only it is one page and it will be more accessible. I personally do not like scroll bars within my pages, but this would be a way to retain your element size.

PS: You can always learn some php, what is being proposed is extremely basic with any server side language.

Ness_du_Frat
01-23-2005, 01:54 PM
yeah, I think I understand what you mean... scrolls ? I think it will be a definite no. I'll use javascript instead. This menu is mainly a design issue, so if I have to put scrolls on it, then I can as well not put the menu at all.. lol !!!
No, I have to learn flash. Coding this in flash is easy, a friend told me. The problem is I have no idea how to make a flash website... lol !!!
If you know anything about that, I would be glad to know it !!!

MstrBob
01-23-2005, 02:38 PM
What is there to know about making a flash website? It's an accessibilty nightmare. It hurts SEO, is only available for graphical browsers with the flash plugin, eliminating a sizable chunk of the web. The only way to mitigate the negative effects of an all Flash website is to then provide an HTML version for those who can't access flash, which means that you know how two websites to update. If it can at all be avoided, don't ever rely on flash for a website.

PeOfEo
01-23-2005, 03:52 PM
Going with javascript for this would be a mistake.

I have heard coding in php is easy, if you are willing to learn flash why would you not be willing to learn php? A server side language can do a heck of a lot more then anything client side.

Ness_du_Frat
01-23-2005, 04:29 PM
But I AM willing to learn php !!! I bought the book, I just need to have some time to start learning it...
Flash, yeah...
I don't like the concept. But, you can do so many cute things !!!! it's just that, I HAVE to learn it. One day or another, I have to know how it works. Even if I'll NEVER do anything professional with it, because, as you said, it's an accessibility nitemare.
It's good for static websites, like websites updated once a century... lol !