Custom, non DD related JavaScripts from other members.
It's not directly obvious from this how we can: - start a movie on page load (question asked by some people on different forums); - specify the dimensions and position of the movies in percentages; - make good use of the ytplayer functions. Autoplay: something like Code: function so_start() { loadNewVideo('lKq9_kk3Zbc', 20); } //IE needs some time window.onload=setTimeout('so_start()',2000) Size of movie in percentages ...
function so_start() { loadNewVideo('lKq9_kk3Zbc', 20); } //IE needs some time window.onload=setTimeout('so_start()',2000)
Updated 08-29-2009 at 01:59 PM by molendijk
If we want the select box to function as a genuine menu, then a click on a given option (of the select box) must give us the same range of possibilities as does a click on the items of a normal menu. So a click should allow us to go to a new page, to open a popup window, to produce an alert etc. We can achieve this with the help of a function that has the following general form: Code: var which=""; function DoSomethingWithOptionvalue(which) { var optionValue = document.getElementById(which).options[document.getElementById(which).selectedIndex].value; ...
var which=""; function DoSomethingWithOptionvalue(which) { var optionValue = document.getElementById(which).options[document.getElementById(which).selectedIndex].value;
Updated 08-12-2009 at 12:20 AM by molendijk
Cookies are often confusing. Much of the confusion can be eliminated if you know that all cookies are strings. If you want to store an array, function, number, or an object in a cookie, you must convert it to a string before storage and upon retrieval change it back into the object/array/function/number that it was. Cookies are therefore best used for string storage and retrieval. This unit doesn't pretend to eliminate all of the possible confusions that can arise from "when and where in ...
Updated 07-10-2010 at 03:59 PM by jscheuer1
In the head: Code: <!--[if IE]> <script type="text/javascript"> document.write('<object type="text/html" id="object_id" width="0" height="0" data="menu.html"><\/object>'); onload=function(){ document.getElementById('main_page_id').innerHTML = document.getElementById('object_id').object.documentElement.innerHTML; } </script> <![endif]--> <!--[if ...
<!--[if IE]> <script type="text/javascript"> document.write('<object type="text/html" id="object_id" width="0" height="0" data="menu.html"><\/object>'); onload=function(){ document.getElementById('main_page_id').innerHTML = document.getElementById('object_id').object.documentElement.innerHTML; } </script> <![endif]--> <!--[if
Updated 05-05-2009 at 10:49 PM by molendijk (Correction)
When we use the technique given below, the following happens when we click on a link (in our HTML-menu) in order to go to a new page (which may belong to a foreign domain): bla.html (our own domain) or h ttp://www.blabla.bla (a foreign domain) is included in a dynamically created text/html-object (non-IE) or iframe (IE) (IE doesn't correctly handle the object yet); the object/iframe containing the new page (bla.html or h ttp://www.blabla.bla) is automatically added to a file ...
Updated 03-24-2009 at 11:25 PM by molendijk