Ajax Updates

Ajax Updates


Showcase Standard Gallery Script using Mootools

Posted: 02 Dec 2009 11:57 AM PST

Using mootools v1.11, this javascript gallery and slideshow system allows you to have simple and smooth (cross-fading…) image galleries, slideshows, showcases and other cool stuff on your website.

Unlike other systems out there, JonDesign’s SmoothGallery is designed from the ground up to be standard compliant: You can feed it from any document, using custom css selectors.

And even better, this solutions is very lightweight: The javascript file is only 24kb.
Why consider it instead of a Flash-based solution ?

* Let’s imagine you want to add a showcase of your last products, or even a showcase of one product on your homepage. Would you want to restrict it only to the users who have Flash enabled ?
* Another important point is the fact that using this script, you will have fully standard compliant web pages (which is important for accessibility, for example).
* Using a flash based solution, search engines won’t see your content nor links. Not really the expected result, right ?
* Oh, and do you really want to rely on a big company’s proprietary licensed app for your website ?
Browser Compatibility:
Since it’s based on the mootools library, it’s somehow platform agnostic. I have fully tested it on:
* Firefox
* Opera
* Internet Explorer 6 and 7
* Safari
Usage:
First step: Install it.

Just insert those lines of code in the header of your html files:

1. Include those lines in your header:

 <script src="scripts/mootools.v1.11.js" type="text/javascript"></script> <script src="scripts/jd.gallery.js" type="text/javascript"></script>   

2. Then, include the css:

 <link rel="stylesheet" href="css/jd.gallery.css" type="text/css" media="screen" />  

Second step: Prepare the meal.

Unlike it’s ancestor Smooth Slideshow, JonDesign’s Smooth Gallery uses a standard compliant (and search engine friendly) way to define the slideshow items.

So, add a code similar to this one (here I added 2 elements) to define the slideshow elements:

 <div id="myGallery"> <div class="imageElement"> <h3>Item 1 Title</h3> <p>Item 1 Description</p> <a href="mypage1.html" title="open image" class="open"></a> <img src="images/brugges2006/1.jpg" class="full" /> <img src="images/brugges2006/1-mini.jpg" class="thumbnail" /> </div> <div class="imageElement"> <h3>Item 2 Title</h3> <p>Item 2 Description</p> <a href="mypage2.html" title="open image" class="open"></a> <img src="images/brugges2006/2.jpg" class="full" /> <img src="images/brugges2006/2-mini.jpg" class="thumbnail" /> </div> </div>   

As you see, everything is contained in a container of id “myGallery” that contains several “imageElement” items.

Each item is composed of four values:

* The first value is enclosed in an h3 tag and defines the title,
* The second one is the current element’s description and is enclosed in a paragraph tag,
* The third is the image link (url in the “href” part of the tag and title in the “title” part). (Only specify it if you have decided to show links in your gallery)
* The fourth one is the full size image file,
* And last but not least, there is finally the thumbnailed image file (Only specify it if you have decided to show the carousel in your gallery. By default, thumbnails are 100px wide and 75px tall).

Please note that the order of the values inside an element is not important, but their classes and type are. You can fully customize how the values are fetched by setting some options.


Demo: http://smoothgallery.jondesign.net/showcase/gallery/
Download: http://github.com/jon1012/smoothgallery/zipball/master
Source: http://smoothgallery.jondesign.net/what/

Related Listings:

  1. Smooth Gallery Ajax Script Using mootools v1.0, this javascript gallery and slideshow system allows...
  2. Customizable jQuery Gallery Plugin: Ad Gallery Ad Gallery is a jQuery plugin for creating an image...
  3. Photo gallery with MooTools Photo Gallery is a open source gallery built with Mootools...

Lightweight Plotr Solutoire PlotKit

Posted: 02 Dec 2009 11:20 AM PST

Solutoire took part of PlotKit and wrote some parts himself, then made Plotr which does not need the Mochikit library to work with. It is also a lightweight charting framework with only 12kb.

Some time ago I was looking for a charting framework for Prototype and I couldn't find it, just because there's none. So that's where it all started. I came across PlotKit, a well written piece of javascript that enables developers to use Canvas or SVG elements for rendering bar, line and pie charts. The only thing was that PlotKit needed the Mochikit library to work. So I took some parts of PlotKit and wrote some parts myself. The result is a lightweight charting framework (12kb!) named Plotr. It's released under the BSD license.

Browser support

Plotr makes use of HTML Canvas. Canvas elements are supported by:

* Firefox 1.5+
* Safari 2.0+
* Opera 9.0+
* IE6+ (emulated)

Canvas HTML is emulated by ExplorerCanvas, a javascript that let's you handle VML the same way as HTML Canvas.

I'm testing Plotr with the following browsers: Safari 2.0.4, Opera 9.10, Firefox 2.0.0.1, IE6 and IE7. If anyone can see the graph below using a browser different from the browser I'm testing with please let me know.


Demos:

Download: http://plotr.googlecode.com/files/plotr-0.3.0.zip
Source: http://solutoire.com/plotr/

Related Listings:

  1. PlotKit – Javascript Chart Plotting Script Making charts is not easy, but when using PlotKit it’s...
  2. Height Transitions using MooTools In this techniques like 'height transitions' and 'class toggles'. Sounds...
  3. fgCharting – Jquery Data visualization in HTML has long been tricky to achieve....

Blackbird Javascript Logging Utility

Posted: 02 Dec 2009 10:13 AM PST

Blackbird offers a dead-simple way to log messages in JavaScript and an attractive console to view and filter them. You might never use alert() again. You can add Blackbird to your page easily, simply download the files and place them on your server or in a local directory on your computer. And then Include blackbird.js and blackbird.css in your page. Blackbird is has been smoke-tested on Internet Explorer 6+, Firefox 2+, Safari 2+, Opera 9.5.

Adding Blackbird to your page

1. Download the files and place them on your server or in a local directory on your computer.
2. Include blackbird.js in your page.
3. Inlcude blackbird.css in your page.

Your HTML source should look similar to the following code:

 <html>   <head>     <script type="text/javascript" src="/PATH/TO/blackbird.js"></script>     <link type="text/css" rel="Stylesheet" href="/PATH/TO/blackbird.css" />     ...   </head>   

Browser compatibility

Blackbird is has been smoke-tested on the following browsers:

* Internet Explorer 6+
* Firefox 2+
* Safari 2+
* Opera 9.5
Usage
Public API

log.toggle()
Hide/show Blackbird
log.move()
Move Blackbird to next fixed positions: top-left, top-right, bottom-left, bottom-right
log.resize()
Expand/contract Blackbird
log.clear()
Clear all contents of Blackbird
log.debug( message )
Add a debug message to Blackbird
message: the string content of the debug message
log.info( message )
Add an info message to Blackbird
message: the string content of the info message
log.warn( message )
Add a warning message to Blackbird
message: the string content of the warn message
log.error( message )
Add an error message to Blackbird
message: the string content of the warn message
log.profile( label )
Start/end a time profiler for Blackbird. If a profiler named string does not exist, create a new profiler. Otherwise, stop the profiler string and display the time elapsed (in ms).
label: the string identifying a specific profile timer
Customization
Changing the namespace

The default configuration attaches the public API for Blackbird to the global variable log. It is possible to have conflicts with existing variable declarations, and it is possible to redefine the global variable log in other blocks of JavaScript. If you want to define a different variable for Blackbird, such as blackbird, replace the assignment for NAMESPACE with any other string.

var NAMESPACE = ‘log’;

can be replaced with:

var NAMESPACE = ‘blackbird’;

or:

var NAMESPACE = ‘myCustomLog’;

The global API will be affected by this change. If you choose to replace log with myCustomLog, then log.debug will become myCustomLog.debug.
Capture & cancel logging statements

If you’re shipping code with logging statements, you might want to capture and cancel commands intended for Blackbird. The following code will do this:

  var log = {   toggle: function() {},   move: function() {},   resize: function() {},   clear: function() {},   debug: function() {},   info: function() {},   warn: function() {},   error: function() {},   profile: function() {} }; 



Demo: http://www.gscottolson.com/blackbirdjs/
Download: http://blackbirdjs.googlecode.com/files/blackbirdjs-1.0.zip
Source: http://www.gscottolson.com/blackbirdjs/

Related Listings:

  1. Ext Core – Cross-Browser Javascript Library Ext Core is a lightweight and feature rich core JavaScript...
  2. Ext Core: Cross-Browser Javascript Library Ext Core is a lightweight and feature rich core JavaScript...
  3. Search Autocomplete with .NET I am working on a rich content app for one...

Sexy LightBox 2.3

Posted: 02 Dec 2009 09:58 AM PST

SexyLightBox is a clon, sexier and more lightweight than the classic LightBox. It was constructed while thinking about web designers toward an easy installation and use. The following examples will show you why it is considered to be “sexy”.

Images

Large images are automatically adjusted to window.

<a href="images/puente_mujer.jpg" rel="sexylightbox" title="Puente de la Mujer - Buenos Aires - Argentina">   <img src="images/small_puente_mujer.jpg" alt="" /> </a>  <a href="images/neuquen.jpg" rel="sexylightbox" title="Neuquén - Patagonia Argentina">   <img src="images/small_neuquen.jpg" alt="" /> </a>  <a href="images/iguazu02.jpg?width=400&height=300" rel="sexylightbox" title="Cataratas del Iguazú">   <img src="images/small_iguazu02.jpg" alt="" /> </a>   

Gallery

  <a href="images/php_mysql.jpg" rel="sexylightbox[group1]" title="PHP y MySQL">   <img src="images/small_php_mysql.jpg" alt=""/> </a>  <a href="images/homerin.jpg"   rel="sexylightbox[group1]" title="D'oh!"      >   <img src="images/small_homerin2.jpg" alt=""/> </a>  <a href="images/futurama.jpg"  rel="sexylightbox[group1]" title="Clap clap!" >   <img src="images/small_clapclap.jpg" alt=""/> </a>  

Animated Gifs

  <a href="images/yo.gif"  rel="sexylightbox" >   <img src="images/yo.jpg" alt=""/> </a>  <a href="images/ryu.gif" rel="sexylightbox" title="Shinkuu Hadouken!!!" >   <img src="images/small_ryu.jpg" alt=""/> </a> 
  <a href="#TB_inline?height=125&width=500&inlineId=myOnPageContent" rel="sexylightbox[22]" title="...">   Show HTML </a>  <a href="#TB_inline?height=125&width=350&inlineId=myOnPageContent" rel="sexylightbox[22]" title="...">   Show HTML with scrollbar </a>  <a href="#TB_inline?height=265&width=320&background=#000&inlineId=videito1" rel="sexylightbox[22]" title="...">   Play Video Julieta Venegas </a>  <a href="#TB_inline?height=260&width=530&background=#000&inlineId=videito2" rel="sexylightbox">   Play Video Rambo Extreme Masacre </a>  <a href="#TB_inline?height=242&width=450&background=#000&modal=1&inlineId=videito3" rel="sexylightbox">   Play Video Rise of the Lycans in Modal Lightbox </a>  

Iframe Content

 <a href="http://www.google.com?TB_iframe=true&height=450&width=800" rel="sexylightbox" >Gooooogle</a>  <a href="demo-iframe.html?TB_iframe=true&height=150&width=300" rel="sexylightbox" >Iframe Example</a>   



Demo: http://www.coders.me/ejemplos/sexy-lightbox-2/
Source: http://www.coders.me/ejemplos/sexy-lightbox-2/

Related Listings:

  1. YUI – A lightbox for All YUI based lightbox demos. Each of the following lightbox holds...
  2. Make Sexy Buttons with CSS This tutorial will teach you how to create pretty looking...
  3. Sexy Combo – jQuery Plugin Sexy Combo is a jQuery plugin that allows you to...

Highcharts – Interactive Charts for Web

Posted: 02 Dec 2009 09:40 AM PST

Highcharts is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. Highcharts currently supports line, spline, area, areaspline, column, bar, pie and scatter chart types.

Features
Compatible
It works in all modern browsers including the iPhone and Internet Explorer from version 6. Standard browsers use the Canvas element and in some cases SVG for the graphics rendering. In Internet Explorer graphics are drawn using VML.
Free for non-commercial

Do you want to use Highcharts for a personal website, a school site or a non-profit organisation? Then you don’t need the author’s permission, just go on and use Highcharts. For commercial websites and projects, see License and Pricing.
Pure JS, no BS!

Highcharts is solely based on native browser technologies and doesn’t require client side plugins like Flash or Java. Furthermore you don’t need to install anything on your server. No PHP or ASP.NET. Highcharts needs three JS files to run: The highcharts.js core, a canvas emulator for IE, and either the jQuery or the MooTools framework. One of these is most likely already in use in your web page.
Numerous chart types

Highcharts supports line, spline, area, areaspline, column, bar, pie and scatter chart types. Any of these can be combined in one chart.
Simple configuration syntax

Setting the Highcharts configuration options requires no special programming skills. The options are given in a JavaScript object notation structure, which is basically a set of keys and values connected by colons, separated by commas and grouped by curly brackets.
Tooltip labels

On hovering the chart Highcharts can display a tooltip text with information on each point and series. The tooltip follows as the user moves the mouse over the graph, and great efforts have been taken to make it stick to the nearest point as well as making it easy to read a point that is below another point.
Datetime axis

75% of all charts with an X and Y axis have a date-time X axis. Therefore Highchart is very intelligent about time values. With milliseconds axis units, Highchart determines where to place the ticks so that they always mark the start of the month or the week, midnight and midday, the full hour etc.
Zooming

By zooming in on a chart you can examine an especially interesting part of the data more closely. Zooming can be in the X or Y dimension, or both.

Inverted chart or reversed axis

Sometimes you need to flip over your chart and make the X axis appear vertical, like for example in a bar chart. Reversing the axis, with the highest values appearing closest to origo, is also supported.
Text rotation for labels

All text labels, including axis labels, data labels for the point and axis titles, can be rotated in any angle.
How to use:
1) Highcharts uses either jQuery or MooTools for some common JavaScript tasks. In addition, Internet Explorer needs ExCanvas which emulates the Canvas element. You need to include these JavaScript files in the section of your web page. If you already have jQuery or MooTools included, you can skip the first one.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="/highcharts/highcharts.js"></script> <script type="text/javascript" src="/highcharts/excanvas-compressed.js"></script>   

2) In a < script > tag in the < head > of your web page, or in a separate .js file, add the JavaScript code to initialize the chart. Note that the id of the div where you want to put the chart (see #3) is given in the renderTo option below:

 <script type="text/javascript">    $(document).ready(function() {       var chart1 = new Highcharts.Chart({          chart: {             renderTo: 'chart-container-1',             defaultSeriesType: 'bar'          },          title: {             text: 'Fruit Consumption'          },          xAxis: {             categories: ['Apples', 'Bananas', 'Oranges]          },          yAxis: {             title: {                text: 'Fruit eaten'             }          },          series: [{             name: 'Jane',             data: [1, 0, 4]          }, {             name: 'John',             data: [5, 7, 3]          }]       });    }); </script>  

The code above uses the jQuery specific way of launching code on document ready, as explained at the jQuery website. If you use MooTools, instead of the $(document).ready() syntax you do it slightly differently:

 <script type="text/javascript">    window.addEvent('domready', function() {       var chart1 = .......  

3) Add a div in your webpage. Give it an id refering to the renderTo option in #2, and set a specific width and height which will be the width and height of your chart.

  <div id="chart-container-1" style="width: 600px; height: 400px"></div> 

How to set up the options

Highcharts uses a JavaScript object structure to define the options. The options are nested into categories. The options are mainly strings and numbers, but some are arrays, other objects or even functions. When you initialize the chart using new Highcharts.Chart, the options object is the first and only parameter you pass.

If you want to apply a set of options to all charts on the same page, use Highcharts.setOptions like shown below.

See #3 above for an example of an options object. For more examples see the demo gallery. For a full reference of the options available, see the options reference.


Demo: http://www.highcharts.com/demo
Download: http://www.highcharts.com/downloads/zips/Highcharts.zip
Source: http://www.highcharts.com/

Related Listings:

  1. Accessible Charts with Canvas and jQuery Script Data visualization in HTML has long been tricky to achieve....
  2. XML SWF Charts XML/SWF Charts is a simple, yet powerful tool to create...
  3. jQuery Flot, Plots, Canvas, Charts Fetch and format the data to be processed by Flot...

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.