Archive for April, 2007

Simple JavaScript Slide Show Using script.aculo.us

59

Apr
17

Simple JavaScript slide shows are a very useful way of slickly displaying images on any site. I recently found my way on to DZone Snippets which provided a nice little article on creating a slide show, so, I thought it would be nice to take that script and add to it slightly making it easier for anyone to add it to their site.

the code

The code is very simple, requiring the inclusion of the following JavaScript files prototype.js, scriptaculous.js, effects.js and simple-slide-show.js. These provide the foundation of the slide show with very little HTML and CSS needed to complete the example.

HTML

The HTML consists of a div containing an unordered list (ul) of the required images. Both the containing div and ul have an id assigned to allow for easy styling without clashes.

<div id="slide-show">

    <ul id="slide-images">
        <li><img src="images/one.jpg" alt="One" title="One" /></li>
        <li><img src="images/two.jpg" alt="Two" title="Two" /></li>
        <li><img src="images/three.jpg" alt="Three" title="Three" /></li>
        <li><img src="images/four.jpg" alt="Four" title="Four" /></li>
    </ul>

</div>

CSS

The CSS is also very simple. The ul is given a width and a height defining the size of the slide show area and finally the li tags are absolutely positioned one on top of the other and that’s it. The rest is all done with JavaScript magic.

#slide-images{
    position:relative;
    display:block;
    margin:0px;
    padding:0px;
    width:400px;
    height:300px;
    overflow:hidden;
}

#slide-images li{
    position:absolute;
    display:block;
    list-style-type:none;
    margin:0px;
    padding:0px;
    background-color:#FFFFFF;
}

#slide-images li img{
    display:block;
    background-color:#FFFFFF;
}

example

Please click to see the Simple JavaScript Slide Show example.

download

Please feel free to download the Simple JavaScript Slide Show code.

NabazTag BBC Weather Feed

2

Apr
15

I have recently stumbled upon a really nice script that reads the BBC weather feed and sends it to a NabazTag.  This is a must have for anybody out there that owns a NabazTag.

link

NabazTag BBC Weather Feed.

Opera Speed Dial

None

Apr
12

Opera Speed DialOpera have released the latest version (9.2) of their browser with a surprisingly nice feature. Opera Speed Dial enables users to speedily select their favourite sites when opening a new tab. A 3×3 grid of thumbnails (showing a visual representation of the chosen site) is displayed allowing users to quickly select their desired sites or add/edit their favourite pages.

Add, edit and delete options are all provided as well as a nice feature allowing users to select their speed dials from a frequently visited pages and open pages list or even allowing users to drag and drop bookmarks onto the grid.

Other options include using Ctrl + [1-9] to quickly access desired speed dial site.

This is a powerful tool and is definitely bringing Opera to the forefront of the browser market. I think it is about time I gave Opera a fair crack for a while and what better time to start.

Have a look for yourself at www.opera.com.

CSS PNG Hack for Internet Explorer (IE)

21

Apr
07

It’s been a problem for many developers. How do you create a transparent image for Internet Explorer 6 using a PNG. As you are all probably aware IE 6 does not support transparent PNGs but don’t panic there is a solution.

the solution

This is by no means new; however, I thought it was worth while posting. By using Alpha filters designed specifically for IE we can force Internet Explorer to behave as expected.  As shown using the code laid out below:

the code

The CSS source is as below.  The first class defines the Alpha filter applied to the containing DIV and also sets a height and width (This has to be the same as the PNGs height and width).

The second class simply hides the original PNG from all versions of Internet Explorer 6 and below.  This is applied as we do not want Internet Explorer to see the PNG twice with the non-transparent version still showing.

.ie-png {
    _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’andrewsellick.png’,sizingMethod=’scale’);
    height: 50px;
    width: 257px;
}

.ie-hide{
    border:0px solid #FFFFFF;
    _display:none;
}

The HTML is also very simple.  Simply add the PNG and wrap it with a containing DIV using the classes as shown below.

<div class="ie-png">
    <img src="andrewsellick.png" class="ie-hide" alt="Andrew Sellick DOT COM" title="Andrew Sellick DOT COM" />
</div>

It’s as simple as that.  Have a look for yourself in the example below.

example

Please have a look at the PNG hack example.

download

Download – PNG Hack Example

Google releases My Maps

1

Apr
06

Google has announced that they are to release their latest technologic wonder known as Google My Maps.

what does Google My Maps do?

The service to be launched in the UK, US, Italy, Germany, France, Canada, Spain, Netherlands, Australia and Japan offers users the ability to add markers (selected from a library), photos, YouTube videos and more.

The maps once created can then be listed for public viewing or unlisted so as to keep it private or just allowing friend’s access.

can’t you do this already?

Google My Maps To date such features have only been available to those that know how to develop using the Google Maps API. I myself have dabbled with the API and found it to be fairly simple to implement, however, this latest product is sure to be a hit with many people around the world and may be helping to push social networking to a new level.

I’m sure we will see this as a feature on many MySpace/Facebook pages in the very near future.

As yet the product has only been launched in Australia and can be found on the Google Maps Australia home page.