View RSS Feed


  1. Adding a click event by class name or by id

    If you want a click event (computer, laptop) or a touchstart event (mobile device) to occur when an arbitrary part of your page is clicked on ('touched') but if you don't want this event to occur (or if you want other events to occur) for regions of your page having a certain id or class name, then jQuery is your friend.
    $(document).on("click touchstart", function (e){
    if('bla'){do this} else {do that}
  2. A Single-Page Application without Framework

    A Single-Page Application is a website that fits on a single page. All necessary code is retrieved with a single page load or dynamically loaded and added to the page as necessary. The page does not reload at any point in the process unless it is manually refreshed. This provides a more fluid user experience.
    SPA has been adopted by several javascript frameworks such as AngularJS, Ember.js, Meteor.js and ExtJS. But these frameworks are overkill in regards to what is needed for a SPA to function ...
  3. A URL-driven tabbing system

    There are many 'tab content scripts' on the web that let you organize hidden DIV contents into a tab interface, with the desired content appearing when a tab is clicked on.
    But most of the time, these scripts merely do that and nothing else. They don't add entries to the browser's history, which implies that the 'panels' are not bookmarkable / that the native browser's back/forward button does not change the state of the selected tabs. And if the scripts use the hash tag for correcting this, ...

    Updated 06-05-2016 at 10:18 PM by molendijk

  4. Using the Google Document Viewer for embedding PDF / opening it in a new window/ tab

    Often PDF-files will not open in Internet Explorer if we just use the regular PDF-URL in the address bar or for the iframe in which we want to embed the file. And often PDF-files are not readable on iOS, or only display the first page of the document.
    These problems don't seem to occur if we use the Google Document Viewer for displaying PDF. Here's some useful code for using the viewer. Its only disadvantage is that it does not allow momentum scroll on iOS.

    Updated 05-23-2016 at 09:19 AM by molendijk (English)

  5. Another Youtube Gallery

    I know there's an excellent YouTube Video Gallery on DD. But I wanted a gallery that
    - shows the videos inside the box containing the thumbnails for the videos, giving them the dimensions of the box;
    - allows the videos to also be shown at full window size (maximize and minimize buttons for the videos);
    - removes the Youtube ads;
    - makes it possible to put text at the top of the thumbnails and at the top of the videos themselves.

    So I made a gallery myself. ...
Page 1 of 10 123 ... LastLast