Javascript

Free Light weight Social media sharing javascript for Facebook, Twitter, Stumble Upon, Digg and Reddit

2010
25
Mar

Social Media Buttons or buttons that help you share the content on bookmarking websites such as Stumble Upon, Reddit or Digg or social networking Websites such as Facebook or Twitter. Adding the buttons helps you to expose your content to a broader audience.
There are lots of social media button providers such as AddThis or ShareThis. I think it is overloaded with features that makes your page load slow as well as bring in unintentional 3rd party javascript code ( or flash tracker ) which runs on your blog.

Read More

JQuery make dynamic draggable and droppable containers

2010
14
Mar
1

The jquery UI javascript has the Draggable and Droppable Interactions inorder to implement a drag drop UI. By default draggable and droppable containers are marked draggable and droppable by jQuery when the page loades, As shown in the code snippet below for the jQuery Drag code and jQuery Drop Code,

jQuery Drop Code using jQuery droppable

$(".dropTarget").droppable({
        drop: function(event, ui) {
           // Drop Logic
        }
    });

jQuery Drag Code using jQuery Draggable

 

Read More

Adding HTML elements dynamically to a page

2009
11
Nov

So when I was sitting idle, moosa asked me how to add dynamic textboxes into a form without loosing values of the form values on the previous textboxes.

So I thought of documenting the method here just in case anyone of you might want this.

So we have a form with a text box as shown below :

:

The goal is to add a form as shown below, Clicking the Add More link will add more input boxes to the html form dynamically.

Read More

Optimize Javascript files with Google Closure compiler

2009
06
Nov

Google has released / open sourced one of its internal tools, the javascript closure compiler. The closure compiler is used to optimize javascript files. It works by analyzing the code and removing redundancies and shortening variable names.
This tool can be used to compress javascript files, (similar to the famous packer), results in lesser code to download, execute, obfuscation and faster user experience.

Read More

Syndicate content