How can I make links usable with HREF and JS code?

Hi guys. I'm making a site out of a template I liked a lot. It mainly uses Bootstrap and some js (which I have no clue on).

I've got the navigation bar filling up beautifully from the DB. Some menu items have children (dropdown menus) and some do not. My problem is that the main menu items (the navigation bar) is made in the template to expect children so when I click on a link inside a children, it takes me to the expected page but when I click on a top-level menu item it does nothing.

Here's the top part of my navigation bar. As you can see there is a HOME button which works if I take out the class attribute out from the link and there is a BROWSE button which shows up as a link and on mouse over it displays a beautiful sub-menu. The links inside the sub-menu work... but the BROWSE main link doesn't take me anywhere:

<li class="dropdown">
	<a href="/" class="dropdown-toggle js-activated">HOME</a> <!-- I can make these work taking out the CLASS -->
</li><!-- /.dropdown -->

<li class="dropdown yamm-fullwidth">
	<a href="browse" class="dropdown-toggle js-activated">BROWSE</a> <!-- These are the ones giving me the hardest time -->
		<ul class="dropdown-menu yamm-dropdown-menu">
			<li>

			<!-- FROM HERE ON ALL WORKS / NO JS ON LINKS AS THEY ARE NOT DROPDOWNS -->

				<div class="yamm-content row">
					<div class="col-sm-4 inner">
						<h4>SOME SUB-MENU TITLE</h4>
						<figure>
							<div class="icon-overlay icn-link">
								<a href="browse/some"><img src="assets/images/static/img54ceb03e707907.63556505.png" alt=""></a>
							</div>
							<figcaption>
								<p>Some text goes here blah blah blah</p>
								<a href="browse/some" class="btn">Some link here</a>
							</figcaption>
						</figure>
					</div><!-- /.col -->
					<div class="col-sm-4 inner">
......................................

Open in new window


Any ideas? Thanks in advance!
LVL 6
Cesar AracenaPHP EnthusiastAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Marco GasiConnect With a Mentor FreelancerCommented:
Evidently you have some javascript which use that class and prevents that anchor to bring somewhere...
But this makes ense: if a menu item has a submenu, it is intended as a 'door' to access to the submenu and usualy it doesn't have a working link itself. But if you want it to work as a link, you have to go through the javascript code attached to the template to find where that class is used and how. Or you have to post the code here :-)
0
 
Marco GasiFreelancerCommented:
To make a link usable you only need to give it a target:
<a href="browse/somepage.html"><img src="assets/images/static/img54ceb03e707907.63556505.png" alt=""></a>

Open in new window

where 'some' is upposed to be a directory and 'somepage.html' the name of the page you want the link bring the user to.
0
 
Cesar AracenaPHP EnthusiastAuthor Commented:
Thanks Marco. Tried that among few other things and nothing happened. If I take out the "class" inside the "a" tags, the links work even if they point to a folder directly.
0
 
Cesar AracenaPHP EnthusiastAuthor Commented:
Hmm... I've been thinking about that and it does makes sense. It's a responsive layout so that wouldn't work properly when used in a touch screen device. I guess I'll have to put every option (i this case I'm talking about a "browse all" link) inside the sub-menu.

Thanks for poiting that out ;)
0
 
Marco GasiFreelancerCommented:
Usually, in touch devices the non-existent hover event is replaced by the tap. I'm using bootstrap  in this period and it does all the work to manage this kind of things. But  I agree, even for space and layout reasons: you can add to the submenu an item 'Brwose all' and you've done :-)
Thanks for points and good luck with your project.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.