Maybe I am being stupid here but I cannot figure out how to respond to a Foundation 5 TopBar dropdown selection with a javascript function. I would like to select a theme for a library I use. To set the theme I need to call a js function.
What I have is:
<div class="fixed">
<nav class="top-bar" data-topbar role="navigation">
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li class="has-dropdown">
<a target='_blank' href="#">Theme</a>
<ul class="dropdown" id="theme-dropdown">
<li><a target='_blank' href="#">Light</a></li>
<li><a target='_blank' href="#">Dark</a></li>
</ul>
</li>
</ul>
</section>
</nav>
</div>
these are of course contained in the topbar <nav>
, etc and the dropdown on the topbar works great in basic HTML mode.
What I am struggling with is how do I make the 2 <li><a>
elements (light and dark themes) call my JavaScript function setTheme(themeName)
when they are clicked?
I cannot seem to find any examples where someone wants to call js from a topbar rather than a URL.
I created a class which sets up a pausable rxjs observable on an interval: export class RepeatingServiceCall<T> { private paused = false; private observable: Observable<T>; ...
I created a class which sets up a pausable rxjs observable on an interval: export class RepeatingServiceCall<T> { private paused = false; private observable: Observable<T>; ...
I'm trying to scrap some information from this ASP page http://laredoute.fr/ppdp/prod-350007615.aspx mainly the first 4 images in high resolution that load in the image-carousel. Depending on the ...
I'm trying to scrap some information from this ASP page http://laredoute.fr/ppdp/prod-350007615.aspx mainly the first 4 images in high resolution that load in the image-carousel. Depending on the ...
I was working on a small JavaScript project to make a tile based game (not homework, don't worry!), however I ran into a problem with my 'tile' class. Each 'tile' has an X and a Y property, for its X ...
I was working on a small JavaScript project to make a tile based game (not homework, don't worry!), however I ran into a problem with my 'tile' class. Each 'tile' has an X and a Y property, for its X ...
I'm using Ramda as my functional programming helper library to build a React app. I'm trying to build myself whereAny. Ramda exposes where which checks if every prop it is given satisfies the ...
I'm using Ramda as my functional programming helper library to build a React app. I'm trying to build myself whereAny. Ramda exposes where which checks if every prop it is given satisfies the ...