|
-
For all that's holy... HELP!
Ok, I've switched to .CSS and using DIVS. What I'm going with is a Header and two columns. The Header will have a static (non-changing) horizontal menu. I need to have each menu option change the menu that appears in the left column.
Then, each menu option in the left column will change what appears in the right column.
Check out my flash site to see what should happen: http://www.nightlord.com
For the life of me, I can't figure out how to get it to work in .CSS.
CASE: Antec P180 | CPU: Intel Core 2 Duo Extreme X6800 | M/B: BFG 680i SLI Motherboard (BIOS P26)
Memory: Corsair Dominator DDR800 (2 x 1 Gig) Video: BFG Nvidia 8800 GTX | HD: 150 Gig Raptor
Sound: On-board for Ventrillo, X-FI Gamer for games | Monitor: DELL 2407WFP
-
LOLWUT
You can't actually do that with pure CSS, at least not the way you are describing it. CSS alone will not let you reload a single div. To do that you are going to need either PHP & XMLHttpRequest or something similar. With only pure CSS you you have to reload the page every time even if you only want new content to appear in a single div.
-
This makes me very sad. 
So why the hell do people hate frames?
CASE: Antec P180 | CPU: Intel Core 2 Duo Extreme X6800 | M/B: BFG 680i SLI Motherboard (BIOS P26)
Memory: Corsair Dominator DDR800 (2 x 1 Gig) Video: BFG Nvidia 8800 GTX | HD: 150 Gig Raptor
Sound: On-board for Ventrillo, X-FI Gamer for games | Monitor: DELL 2407WFP
-
nuclear launch detected
bitfenix prodigy, i5 4670k, asrock z87e-itx, zotac gtx 970, crucial m500 msata, seasonic x650, dell st2220t
-
LOLWUT
 Originally Posted by Nightlord
This makes me very sad. 
So why the hell do people hate frames?
Frames died years ago. Why really isn't terribly important, but IIRC frames have been completely deprecated in XHTML. I think they were even deprecated in previous versions of HTML.
Now, you can do this kind of thing with AJAX controls, but that can get a little messy if you have no idea how to work with JavaScript.
I'd actually recommend simple PHP for this kind of thing. You can figure it out in just a few hours, assuming you have a server with PHP 4 or later (earlier versions will probably work too, but you might not be able to find a good tutorial).
Basically, with something like PHP you can create "frames" as separate PHP files, then you create a master file that includes the other content files. You kind of mash it up just like you would with frames. Every time you click, the entire page does have to refresh, but the server will create the new page quickly and dynamically. So if you want to change the header, you just change the header file and all the other files that use that are updated, so to speak, automatically. Larry Ullman has a book called PHP and PHP & MySQL that's published by Peachpit Press. IIRC, the book walks you how to dynamically create pages with PHP in like the first 50 pages. It should be enough to help you figure out how to do what it is you want to do. Probably find a really easy walk through on the interwebs too.
Truth be told though, for columns you are better off making use of XMLHttpRequest, but you are probably going to have to pick up a book on JavaScript.
Last edited by ImaNihilist; 08-04-2007 at 06:41 PM.
-
LOLWUT
Also, you might just be able to rip something someone else used. I'd have a look around cssplay.co.uk
-
Really Cold Shark
How much content are we talking about? Is it worth going back to the server to get it? If it's not dynamic content, I don't think you need to do an asynchronous request to get it, you can just put it all on the page and then swap it with a client-side script.
If you have a lot of content (or the content needs to be dynamic), then you'll need to do a very simple AJAX request (just a GET of the new content) and then replace the inner html of the div.
Either way you're looking at less than 20 lines of javascript and none of it will be anything fancy.
-
LOLWUT
 Originally Posted by eshbach
How much content are we talking about? Is it worth going back to the server to get it? If it's not dynamic content, I don't think you need to do an asynchronous request to get it, you can just put it all on the page and then swap it with a client-side script.
If you have a lot of content (or the content needs to be dynamic), then you'll need to do a very simple AJAX request (just a GET of the new content) and then replace the inner html of the div.
Either way you're looking at less than 20 lines of javascript and none of it will be anything fancy.
For someone moving from simple HTML to what is perceived to be "complex" CSS, 20 lines of JScript is scary as hell!
-
Tiger Shark
You can use an inline frame for this.
-
Really Cold Shark
 Originally Posted by JPnyc
You can use an inline frame for this.
You could, but it's not in the XHTML standard and would be considered bad practice.
-
Ultra Great White Shark!!
 Originally Posted by kpxgq
AJAX ftw
If it is a small amount of content go that way.
www.myeducational plan.com-come see my plan to fix the USA educational system. I hope this is sig legal. Major Site Design Update on July 18, 2006. On June 18, 2009 passed the 10,000 post mark. December 24, 2009: Major Theme change and more....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|