View RSS Feed

Most Popular Blogs

  1. document.getElementById shortcut

    I'm amazed at how many people don't use a very simple shortcut for document.getElementById. This is for all the people who don't use a javascript library like jQuery.

    All you have to do is include this code somewhere on your page

    Code:
    function $(element) {
    return document.getElementById(element);
    }
    Then when you want to use document.getElementById('id'); just type $('id'); instead.

    Example

    Code:
    <html>
    ...
    Categories
    JavaScript & Ajax
  2. Simple Controls Gallery- Adding left/right arrow keys navigation

    Original Script: Simple Controls Gallery v1.3

    Changes: This modified version of simplegallery.js hooks up the left and right arrow keys on the keyboard so pressing them moves the gallery back and forth, respectively, in addition to the default navigation methods of course.

    Usage: Just replace the original .js file with the modified one.

    Updated 03-09-2009 at 07:58 PM by ddadmin

    Categories
    DD Scripts Mods
    Attached Thumbnails Attached Files
  3. Generics in Javascript

    I just used this code to vent some frustration earlier, hope you all like it. It's pretty self-explanatory. It's probably too theoretical to go into the DD script archives, so I'll just leave it lying about here.

    Code:
    var Generic = (function() {
      var MATCH_FAIL = {},
          MATCH_ANY  = function() { return MATCH_ANY; };
    
      function create(fallback) {
        var s = function() {
          for (var i = 0, args = Array.prototype.slice.call(arguments),
    ...
  4. 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
  5. Combining Ultimate Fade-in Slideshow 2.1 and Lightwindow 2.0

    I've found that this actually can work. It makes an interesting use of the slide show's undocumented oninit feature, and how well the slide show is written visa vis jQuery's No Conflict mode. I would generally advise using two scripts which work off of the same script library, rather than two different script libraries. However, in this case both scripts are so robust, who can resist?

    That said, all you need to do to set up a demo is to follow the instructions for Ultimate Fade ...

    Updated 09-24-2010 at 09:57 PM by jscheuer1 (Flesh out Links to demo, source scripts)

    Categories
    DD Scripts Mods , JavaScript & Ajax
Page 11 of 15 FirstFirst ... 910111213 ... LastLast