1. Easily insert a Xbox Live gamer card into your website

    Searched for about 30 minutes on how to do it earlier today as mygamercard.net is extremely slow and unreliable. Here’s how to do it yourself by using Xbox.com (which is very reliable and fast):

    <iframe src=”http://gamercard.xbox.com/MyGamerTag.card” class=”gamercard” width=”204″ height=”141″ scrolling=”no” frameBorder=”0″></iframe>

    Simply replace MyGamerTag with your own – and insert it where you would like your gamer card on your site – simple.

    1 Comment »
  2. Earthquake Effect: Shake the browser using JavaScript

    Note: This post was imported from the very old Twod.co.uk post archives.

    This snippet of code will produce a JavaScript function which you can then attach via a JavaScript call and shake the user’s Internet browser.

    Place this anywhere before you’re going to call the function, or remove the surrounding <script> tags and place it within an external JavaScript file.

    <script type=”text/javascript”>
    function shake(n) {
    if (parent.moveBy) {
    for (i = 10; i > 0; i–) {
    for (j = n; j > 0; j–) {
    parent.moveBy(0,i);
    parent.moveBy(i,0);
    parent.moveBy(0,-i);
    parent.moveBy(-i,0);
    }
    }
    }
    }
    </script>

    An example of this function being called using the onclick method would look as follows:

    <input type=”button” onclick=”javascript:shake(200)” value=”Shake Me!” />

    This will produce (go ahead, click for an example of the effect):

    1 Comment »