Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
Keep dropdown menu open even after visiting another page?

I have a drop down menu and I am trying to keep it open even after leaving the website and coming back.

Here is the php code that is in the file:

<?php
                $totalTrajectories = count($trajectory_data);
                $perColumnElement = round($totalTrajectories / 3);
                $counter = 1;
                foreach($trajectory_data as $key => $values){
                    echo getLtCards($values);
                    /*if($counter % $perColumnElement ==0 && $counter > 1){
                        echo '</div></div><div class="col-md-4"><div class="card-columns">';
                    }*/
                    if($counter==8 || $counter==15 || $counter==20){
                    // if($counter==6 || $counter==12 || $counter==19){
                        echo '</div></div><div class="col-md-4"><div class="card-columns">';
                    }
                    $counter++;

                }
               ?>

Here is the code for one of the drop down menus (this is from inspect element):

<div class="card-header card-header-primary mb-3">
                <a class="card-link cardCat collapsed" data-toggle="collapse" data-cat="1,2" href="#card_5" aria-expanded="false">
                  <div class="card-icon d-flex" style="align-items: center;">
                    <h4 class="title m-0">
                    <span class="cs-icon nm_icon"></span> <span class="cs-icon op_icon"></span> 
                    Menu 1 </h4>
                    <i class="fa fa-arrow-circle-down text-white ml-auto"></i>
                  </div>
                </a>
              </div>

I want to use local storage to do this, so I just added this code to the file:

localStorage.setItem('dropdownMenu', 'true');
localStorage.getItem('dropdownMenu');

This isn't working and I'm guessing its because I am not checking if it's set or not and checking its value. How can I check for this or fix it?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!