Targeting Div as a link

Hi I have a dropdown nav that I want to target certain
divs as a link I have my content in tabs. Website
it does not go the respective div

These are the links in my header “products” dropdown:

<li><a href="http://preferreddentist.com/products.html#sonictooth">Sonic Toothbrush</a></li>
                    <li><a href="http://preferreddentist.com/products.html#sonictoothheads">Sonic Toothbrush Heads</a></li>
                    <li><a href="http://preferreddentist.com/products.html#sonictravel">Sonic Toothbrush Travel</a></li>
                    <li><a href="http://preferreddentist.com/products.html#sonictravelplus">Sonic Toothbrush Plus</a></li>

Targeting these: (example)

<div role="tabpanel" class="tab-pane prd-wrap" id="sonictravelplus">

Hi,

It looks like you are trying to go to a div that is inside a hidden tab which is impossible without script (not to mention that you have 2 ids called sonictravelplus which is invalid).

You would need to intercept the url and grab the fragment identifier with js and then activate a click on the menu you want to open and then go to the div in that tab.

Someone asked a similar question here and if you look at post #7 there seems to be a solution that you could perhaps modify to work for you. If not it will be another question for the JS forum to sort out :smile:

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.