0
Hi! I just created my stack accountoverflow. I’m always researching things here and learning more about programming. Well, as I’m starting now and understand very little programming, I started with a ready-made Bootstrap template (this one).
I need to make a button have 2 actions, in case, 2 "href". Why? I’m doing (editing right, I don’t know how to program yet hehe) a site for documentation of some things of the Company. I need a side menu button (sidebar) to have two actions that would be them:
1° scroll the screen down to the documentation specific section field; 2° open this section-specific field.
As I got a template ready, I’m using a function that I found very cool that is the "Collapse", so the menus are "hidden" as if it were a Spoiler, hiding the contents of that session of the document.
To sum up, scroll the screen until the session and open this "spoiler" to show the content. I will leave here 2 links of "demonstration" of how it works.
I can make a button open the sessions using href and a ID that I give to the div where it says "Session 1", "Session 2" and so on. Example:
Div:
<div id="abrirsessao"></div>
Roll to the div:
<a class="collapse-item" href="#abrirsessao" data-toggle="collapse">Abrir Sessão</a>
I can also roll the page down using the href + ID of the div. Example:
Div:
<div id="rolarsessao"></div>
To:
<a class="collapse-item" href="#rolarsessao">Rolar até a sessão</a>
I believe the problem is because there is a div inside the other. If I can assign 2 "href’s", one to the #scroll and another to the #open I believe it would work.
From now on I thank anyone who can help (or try) :D
I recommend jQuery (although the language is not part of the tags) using onclick with show/Hide.
– Groot
Do you have any tutorial that you can tell me about this? I’m starting in programming and I don’t have much idea.
– Roger Windberg