Viewing Dropdown button anywhere?
Dropdown button anywhere?
|
User: Richard S. 11 years ago
|
|
| Do I need to use the Navigation widget to get a button that has a dropdown list. For example, I want to create a button "Back Issues" that drops down to a list (links) by month. | |
|
User: Ozzy S. 11 years ago
|
|
|
Hi Richard, There is no built in function for drop down menus, but you can use an HTML Snippet to make what you want. Use the below code to create the drop down. Replace the underlined text with the desired link (relative or absolute). Replace the bold text with the name of the option. Do NOT edit the italicized text, but include it in the HTML Snippet. You can add more options by adding the <option> tags along with the href="". <select id="back-issues"> <option>Back Issues</option> <option href="http://www.apple.com">value 1</option> </select> <script> document.getElementById('back-issues').onchange = function() { window.location.href = this.children[this.selectedIndex].getAttribute('href'); } </script> The only problem with using this is that you have to edit the code each time you need to change it. Last edit 11 years ago ------------------------------- Ozzy Simpson | Oznorts ------------------------------- EverWeb users get a 10% discount on our hosting services! Just use promo code EVERWEB10 to receive the discount! ------------------------------- Facebook | Twitter | Instagram |
|
|
User: Richard S. 11 years ago
|
|
| thank you Ozzy. I'll give it try. Rich | |
|
User: Ozzy S. 11 years ago
|
|
|
No problem Rich. Let me know if it doesn't work.
------------------------------- Ozzy Simpson | Oznorts ------------------------------- EverWeb users get a 10% discount on our hosting services! Just use promo code EVERWEB10 to receive the discount! ------------------------------- Facebook | Twitter | Instagram |
|
|
User: Richard S. 11 years ago
|
|
| Ozzie, it sort of works. I get the drop down and can make the selection, but the selection stays in the box and you have to select Back Issues to get back and of course it gets a not found url. Also would like the selection to open a new page. | |
|
User: Ozzy S. 11 years ago
|
|
|
Hi Rich, I figured out a way to fix the not found error, use the updated code below. I could not, though, find a way for the link to open in a new window. Again, replace the underlined text with the desired link (relative or absolute). Replace the bold text with the name of the option. Do NOT edit the italicized text, but include it in the HTML Snippet. You can add more options by adding the <option> tags along with the href="". <select id="back-issues"> <option href="">Back Issues</option> <option href="http://www.apple.com">Apple</option> </select> <script> document.getElementById('back-issues').onchange = function() { window.location.href = this.children[this.selectedIndex].getAttribute('href'); } </script> Alternatively, you could use Roddy's Mobile Website Click To Drop Down Navigation widget to do what you are wanting to do. This method will probably be easier. Last edit 11 years ago ------------------------------- Ozzy Simpson | Oznorts ------------------------------- EverWeb users get a 10% discount on our hosting services! Just use promo code EVERWEB10 to receive the discount! ------------------------------- Facebook | Twitter | Instagram |
|
|
✔ Best Answer
|
|
|
User: Richard S. 11 years ago
|
|
| Ozzy, thanks. That works better. | |
|
User: Ozzy S. 11 years ago
|
|
|
HI Richard, Roddy just released a new widget that allows you to do what you were trying to do. Check it out. He also has one for internal links. It allows for styling, and the ability to open links in a new window. Last edit 11 years ago ------------------------------- Ozzy Simpson | Oznorts ------------------------------- EverWeb users get a 10% discount on our hosting services! Just use promo code EVERWEB10 to receive the discount! ------------------------------- Facebook | Twitter | Instagram |
|
|
User: Richard S. 11 years ago
|
|
| thanks for the heads up. I had just purchased Roddy's navigation set of widgets and found that they only linked to internal pages so I asked Roddy to allow links to files and he reciprocated quickly with a widget to do just that. He is a great guy! | |
| Post Reply |
| You must login or signup to post. |
