Jump to content

GregFrey

New Members
  • Posts

    6
  • Joined

  • Last visited

GregFrey's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. @Jacques1: Yes as I say my knowledge is very limited. When you say "// However this is determined" you are saying it could a url? Or what other factors could determine it? Your solution looks very much like what I was originally trying to achieve.
  2. I am an idiot. Huge facepalm on my side. You are absolutely correct. Such an elegant solution. Thank you very much for the solution and your patience.
  3. Thanks mac_guyver and requinix. @requinix the problem is that the menu is being pulled via a php include, so as there are no if statements in css i cannot specify that on <body id="home"> the "nav li.home a" be assigned a class of 'active'. Jquery is the obvious answer to the problem of course, but the active class is being stripped from the nav as soon as the page scrolls, as outlined above. In any case may thanks for the insights and proposals of everyone who has replied.
  4. Thank you for your reply Barand. I did try that and under normal circumstances it would have worked but for some reason fullpage.js strips the active class out of the menu as soon as the page scrolls. So I was hoping for a php solution which would bypass the jquery.
  5. I have a rudimentary grasp of php. Enough to do basic website templating and I am slowly learning the language, so I apologise if this is an exteremely stupid question. In php how would one refer to the body tag id in order to assign a class to an li in the menu for example? eg: <nav> <ul id="menu"> <li> <a href="/index" class="<?php if(body id="home"){echo "active"} ?> ">Home</a> </li> </ul> </nav>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.