Jump to content

d_quiri

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by d_quiri

  1. Hm ok. The URL looks actually like this: domain.com/?team=firstname-name And the print gives the same i have in the code: ?team=firstname-name So I tried this also ... (Does it have to be the whole string? Best be would with just the "/?team=" part) Is there a problem with where it is located? In the <head> Tag is right?
  2. Ok, thanks. I tried ... but put it in the wrong place? Is the structure right in the first place? <script type="text/javascript"> if ( window.location.search == "?team" ) { $("#menu-item-234").addClass("active"); } else if { window.location.search !== "?team"} { $("#menu-item-234").removeClass("active"); }; </script>
  3. Hello, i'm a media designer with a very basic knownledge of JS. I have problem with a script on a website i created and would love some help... Here is the situation: In the main menu of my Wordpress website I have a page that includes three different profile pages that are reachable through another menu on this certain page. But the main menu topic doesn't show as active with this profile pages. These profiles create an URL like that: ?team=name. My idea: to "addClass" the class "active" in the main menu topic (#menu-item-234) when this part "?team" is shown in the URL. I tried to code it but I'm not surprised it doesn't work... ;-) I don't really know what i'm doing ..Did I explain it understandable? Can someone help me, I would appreciate it very much.. <script type="text/javascript"> $(document).ready(function(){ if ( document.location.hash === '?team' ) { $("#menu-item-234").addClass("active"); } else if { document.location.hash !== '?team' } { $("#menu-item-234").removeClass("active"); } });</script>
×
×
  • Create New...