View RSS Feed

molendijk

  1. YouTube Chromeless Player

    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 ...

    Updated 08-29-2009 at 01:59 PM by molendijk

    Categories
    Post a JavaScript , Flash related
  2. Using the Select Box as a Navigation Tool

    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;
    ...

    Updated 08-12-2009 at 12:20 AM by molendijk

    Categories
    Post a JavaScript
  3. Document.write issues

    The Ajax Includes Script given at http://www.dynamicdrive.com/dynamici...axincludes.htm uses document.write for including external content. Advantage: you don't have to explicitly bring the js belonging to the external file(s) to the main page. But beware the results in certain cases! In IE, (external) scripts added to the page using document.write are not run until after the document.write that adds them has finished. Non-IE browsers will run them straight away. So
    Code:
    <script type="text/javascript">
    ...

    Updated 05-16-2009 at 11:55 PM by molendijk (Forgot to mention category)

    Categories
    JavaScript & Ajax
  4. Extract external HTML via a hidden text/html-object

    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
    ...

    Updated 05-05-2009 at 10:49 PM by molendijk (Correction)

    Categories
    Post a JavaScript
  5. Passing data (whole pages) to a file ('index.html') containing a HTML-menu

    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

    Categories
    Post a JavaScript
Page 11 of 12 FirstFirst ... 9101112 LastLast