Using Center Div For Everything [RESOLVED]

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Using Center Div For Everything [RESOLVED]

Post by Epiales »

Okay, I know it can be done, but I'm struggling here.

I have a setup that has 3 divs... a left, center, and right. I have links on the left and the right. I want to be able to click on the links and have everything working in the center div. I have used bypass to get the list of members, but it shows the members in the center no matter what place I am at. I haven't figured out how to bypass the members in the center div and have it show either nothing, or something else when I click on it. Ultimately like this:

click on members, center div shows members
click on shop, center div removes the members and then shows the shops
click on travel and it removes what was there and shows travel

I'm sure it has to do with the bypass? I just haven't figured it out yet. Thanks for suggestions.

Whn I click members, It shows them:

Image

But something else it shows

Image

And you can also see my health bar lol, it's at 100% but not all the way across... but I have that in another thread.... Thanks guys

EPI
Last edited by Epiales on Fri Sep 26, 2014 3:41 pm, edited 1 time in total.
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Using Center Div For Everything

Post by Epiales »

Okay, I rewatched the video on using the $bypass, but not sure how it will work with my divs...

If I use the bypass, then it ends up not even showing the right side div I have with the links on it. Just completely removes it. I'm kind of stuck here at the moment and can't do much until I figure out how to do it. Probably something easy, but I can't wrap my head around it.
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Using Center Div For Everything

Post by OldRod »

I'm not familiar with $bypass, but I attempted something similar a few years back.

If I remember right, I made a javascript function that cleared the center div and populated it with different stuff based on what was clicked. Then in the link on the left hand bar, have an OnClick() event that fed the javascript function a keyword that let it know which button had been clicked.

Seems like that did what you are attempting, but it's been so long I don't have the code any more.

Check out something like this:

http://www.willmaster.com/library/web-d ... ontent.php
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Using Center Div For Everything

Post by OldRod »

Or this... this is how I remember doing it:

http://codepen.io/johnmotyljr/pen/qhvue
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Using Center Div For Everything

Post by Epiales »

Thank you, I will see if I can't figure something out.

In the meantime, I created a leftside page and a rightside page and then use php include to add them to the main page.....

I then used css to be able to place them at the very top of the page and then used css to put the middle div right in the middle.

Code: Select all

<?php include_once("php_includes/check_login_status.php")?>
<?php include_once("leftbar.php")?>
<?php include_once("rightbar.php");  ?>  

<div id="pageMiddle">
Problem is, is upon clicking the GAME link, and upon PAGELOAD, which is the same page, it always shows the members that are there, but doesn't work because you didn't click on members to see it, so there's a bungch of gobbly gook errors there lol....

GRRRRR
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Using Center Div For Everything

Post by Epiales »

OMG finally... It all consisted of me changing the

Code: Select all

if ($bypass != 1) {
to a zero

Code: Select all

if ($bypass != 0) {

LOL, but it works fine now whew.... Nice links though. thank you for sharing.
Nothing fancy, but a work in progress!

http://gameplaytoday.net
Post Reply

Return to “Beginner Help and Support”