Featured

YUI Based Lightbox - Revisited

Posted on August 17, 2007
Filed Under Javascript | 63 Comments
Tags: , , ,
post image Note: This script has been updaed In the previous article of YUI based lightbox, I've shown you how easily one can create a lightbox using YUI's Dialog class. Although the lightbox we created in the previous article has the basic skeleton of a lightbox, it still lacks some crucial features and it looks quite ugly. Luckily [...]
Read more »
Lastest

A Simple Yet Powerful PHP Template Engine

Posted on June 28, 2009
Filed Under HTML, PHP | 2 Comments
Tags: , , ,

This is not yet another regular expression replacement template engine. The template engine uses PHP itself to render the template. The template itself is very intuitive to people who are already familiar with PHP. There is no extra learning for additional syntax - the template code itself is just plain PHP code. Though I haven't done any benchmark, from my past experience of using it, it is pretty fast - consider that it consists of less than 100 lines of code. Thinking of using Smarty?

Read more »
Archives

ctRotator - A Flexible Item/Image Rotator Script for jQuery

Posted on November 12, 2008
Filed Under Javascript, WordPress | 23 Comments
No tag for this post.

I was taking part in developing an interesting web application - the Thank You Project. During which I made an item rotator script that swaps a list of messages in and out from the message board. I find the rotator script is very useful, so I decide to share it. To get an overview of what the script can do, you can check the demonstration page first.

Read more »

Ajax Response Helper for PHP

Posted on October 1, 2008
Filed Under Javascript, PHP | 1 Comment
Tags: ,

In Ajax programming development, passing data back and forth between client and server is a common task. There are two major data formats that one can use for this purpose, namely XML and JSON. My personal preference is JSON because I find it's less verbose and easier to parse.

Although latest PHP provides a very handy function (json_encode) for outputting data in JSON format, for almost every Ajax request I handle on the server side, I have to routinely format the data in a certain way so I can use it conveniently on the client side. For example, to indicate whether it is a valid Ajax request, I embed an field called has_error in every response. I find it's getting annoying after a while, so I wrote a class to automate things a bit.

Read more »

Fading Effect with YUI’s Animation Utility

Posted on May 2, 2008
Filed Under Javascript | 9 Comments
No tag for this post.

In YUI's Animation Utility example page there are demonstrations on how to create color and motion animations. However I couldn't find an example for how to create fading effect. After spending some time on trying different approaches, I came up with this code snip:





var aniObj = new YAHOO.util.Anim(
  'DOM reference or ID' ,
  { opacity: {from: 0, to: 1 } },
  'duration in second',
  'easing'
);

where easing can be one of the following:

YAHOO.util.Easing.backBoth
YAHOO.util.Easing.backIn
YAHOO.util.Easing.backOut
YAHOO.util.Easing.bounceBoth
YAHOO.util.Easing.bounceIn
YAHOO.util.Easing.bounceOut
YAHOO.util.Easing.easeBoth
YAHOO.util.Easing.easeBothStrong
YAHOO.util.Easing.easeIn
YAHOO.util.Easing.easeInStrong
YAHOO.util.Easing.easeNone
YAHOO.util.Easing.easeOut
YAHOO.util.Easing.easeOutStrong
YAHOO.util.Easing.elasticBoth
YAHOO.util.Easing.elasticIn
YAHOO.util.Easing.elasticOut

Creating a Digg This Button for Your WordPress Blog

Posted on April 30, 2008
Filed Under Javascript, WordPress | 4 Comments
No tag for this post.

Creating a Digg This button is very easy. Here's a non-plugin approach:

<script type="text/javascript">
digg_url = '<?php the_permalink() ?>';
digg_title = '<?php the_title() ?>';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

Copy and paste above script to anywhere between your WordPress' theloop:



Instead post specific Digg button, you can create a site wide button as well:

<script type="text/javascript">
digg_url = '<?php bloginfo('url'); ?>';
digg_title = '<?php bloginfo('name'); ?>';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>



Read more »

JavaScript Source Joiner/Combiner

Posted on March 18, 2008
Filed Under Java, Javascript | 1 Comment
Tags: , , ,

The complexity of JavaScript code has increased rapidly over the last two years. The emerging of various JavaScript libraries/frameworks along with Ajax technology enable us to build sophisticate applications which are comparable to desktop ones. A mid-size to large-size Ajax/JavaScript applications normally consist of thousands lines of code. For readability and navigability, it is practical and logical to separate the code into different files. For example, allocate one file for each class. Many developers don't want to or at least hesitated at doing so because more JavaScript files means additional HTTP requests to the server, which impacts page loading efficiency.

Read more »

Page 1 of 612345»...Last »

Categories

Polls

  • Your opinion about the design of this site:

    View Results

    Loading ... Loading ...