• I would like you to understand me, I have a link on another website, this is the link from eg: https://restaurante.cistelsa.com/#fdm-parrillada, in this case the target class is not highlighted when loading the page, I I noticed that on the same page if I create a link equal to the one in the previous example, it is highlighted. I don’t have links or menus and I don’t need them in this project, but I do want the highlight to exist in the target class when I come from another website or if the page loads again, how can I achieve it?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author malihu

    (@malihu)

    The plugin cannot highlight elements without links.

    You can do what you need in 2 ways:

    1)Use css :target selector like this:

    h3:target {
        background: #ff0;
    }

    2)Add links for each item title and then hide them via CSS like this:

    a._mPS2id-h{
        display: none;
    }

    Hope this helps

    Thread Starter cistelsa

    (@cistelsa)

    ok thanks I will try, although I investigated in a very separate way and I achieved this jquery:

    <script>
    var hash = window.location.hash.substring(1);
    jQuery(document).ready(function($) {
        if(hash != ''){
            $('#' + hash).addClass('select-product');
        } else {
            $('#' + hash).removeClass('select-product');
        }
    });
    </script>

    then CSS for my case:

    .select-product {
        background: #fff8f8;
        border: 2px solid #de6464;
    }

    thanks

    • This reply was modified 4 years, 6 months ago by cistelsa.
    Plugin Author malihu

    (@malihu)

    Sure, that’ll work too ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem highlighting Class of target element’ is closed to new replies.