View RSS Feed

molendijk

  1. Using the main scrollbar to scroll an iframe

    If we want to use the browser's scrollbar to scroll the content of an iframe, we must do the following:
    1. calculate iframe's offsetHeight + pixel distance of top of iframe with respect to top of main window + pixel distance of bottom of iframe with respect to bottom of main window ;
    2. give the main window a pixel height that is identical to the result of that calculation;
    3. make sure that the value for the number of pixels that the content of the iframe is scrolled upward (in the case of
    ...
    Categories
    Uncategorized
  2. Embedding and programmatically controlling multiple YouTube videos

    We can embed and programmatically control multiple YouTube videos by putting onloads like the following in (existing) iframes:
    onload="player1=new YT.Player(this)"
    onload="player2=new YT.Player(this)"

    etc.

    The names for the players (here: player 1 and player2) are arbitrarily chosen. They must be used for selecting the video for which we want to execute javascript (video) code. For instance, player2.playVideo() means that the video associated ...

    Updated 12-07-2014 at 03:15 PM by molendijk

    Categories
    Uncategorized
  3. Creating a rt-editor without installing software. Adding php for saving the edits.

    It's not easy to find a good rich text editor on the internet that:
    1. explains in comprehensive terms how to save the edits online, that is, how to send them to the server (or that at least uses clear instructions on how to do it);
    2. does not require that software be installed on your hard disc.

    So I created my own personal file explaining (to myself) how to achieve 1 and 2 above. Some of you may be interested in it, so here's the result. You can find all the explanations ...

    Updated 10-20-2014 at 09:19 PM by molendijk (typo)

    Categories
    Uncategorized
  4. CleanYouTube

    Some time ago I explained on my blog how we can play youtube-videos without the clutter through our own domain (well, sort of), see this. Some people who are using the script have told me that it works well, but that its usage is a bit cumbersome.

    So I decided to create a new script that is supposed to be more user-friendly. It has two parts, which are interlinked:
    (i) a part displaying a page where the user can directly type a cleanyoutube-URL into the address bar (url: http://mesdomaines.nu/cleanyoutube); ...

    Updated 10-15-2014 at 09:19 PM by molendijk (Example added.)

    Categories
    Uncategorized
  5. Loading files into divs having a custom src attribute

    The HTML src attribute supports frame, iframe, img, input and script elements. It does not support the div element. But HTML 5 gives us the "data" attribute that lets us define custom attributes within HTML elements. We can create whatever we want: <div data-brand=..., <div data-mymusic=... etc. So we can also have <div data-src=...

    We can retrieve the value of the "data-" attributes by using getAttribute() and then use the output in all sorts of javascript ...

    Updated 08-16-2014 at 10:33 PM by molendijk

    Categories
    Uncategorized
Page 2 of 9 FirstFirst 1234 ... LastLast