Hi Ahmet,
if your question is how to make sure your JS-based drop-down menu work, you need two things:
1) render the necessary HTML in the template (of type FTL, I presume) of the appropriate page component
(see the standard MenuComponent [1] for reference), and
2) make sure that the JS is available in the site. This can be done by statically including it in the root template of your site, or by making a head-contribution [2] from a child component of a page which desired to render the menu.
If I misunderstood you and you would like to generate a menu based on repository *content* instead, have a look at the "repository-based menu" section in [3].
HTH
Tobi