Creating Navigation Navigation Menus Using <select>

I managed to make a menu navigation menu using html <select> . However, I ran into one problem.

My external links do not work. Namely Youtube.

Here is the code:

  <select ONCHANGE="location = this.options[this.selectedIndex].value;"> <option value="" selected="selected">Navigation</option> <option value="index.html">Home</option> <option value="detroitvideoproduction.html">Video Production</option> <option value="locationsounddetroit.html">Location Sound</option> <option value="videoeditingdetroit.html">Video Editing</option> <option value="custommotiongraphicsdetroit.html">Custom Graphics</option> <option value="demoreel.html">Demo Reel</option> <option value="http://www.youtube.com/user/VideoDetroitMI?ob=0">You Tube</option> <option value="http://vimeo.com/liveoutloudproductions">Vimeo</option> <option value="dslrrentalsdetroit.html">Camera Rental</option> <option value="lectrosonicsrentalsdetroit.html">Audio Rental</option> <option value="griprentalsdetroit.html">Grip Rental</option> <option value="camerasupportdetroit.html">Camera Support</option> <option value="about.html">About Us</option> <option value="contact.html">Contact</option> </select> 

As you can see, I have 2 external links. One is Vimeo, the other is Youtube. When you select Vimeo, it works fine and takes you to the corresponding vimeo page, but when you select Youtube, it does nothing.

I know that the URL in the link is correct, I checked it before I posted this.

Does anyone know why Youtube will not work when Vimeo is?

+6
source share
3 answers

Well, you don’t want to hear it, but it worked for me ... I copied and pasted the code and tested it with Chrome, and it went very well to your page.

+3
source

You might want to change you to: Change: window.location.href = this.value

+1
source

Some browsers may mind viewing? in a row in the selection list. Try converting the YouTube URL using TinyURL. I have not tested, but I guess this will do the trick.

0
source

Source: https://habr.com/ru/post/917556/


All Articles