Showing posts from February, 2014

A fair play with Maths and JQuery Animation

This is a new try with the simple maths that we already know. I have used basic trigonometric equations and JQuery animation for the play.

DEMODemo Explained:Create set of div and append it to the body
for (var i = 0; i < 360; i++) { //random color var color = '#'+parseInt(Math.random()*0xccccc); //create and append DOM $('<div/>').appendTo('body').css('background',color); } For random positioning use Math.random() to generate random x,y values

for (var i = 0; i < 360; i++) { var left = 100 + Math.random() * 300 + 'px'; var top = 100 + Math.random() * 300 + 'px'; $('div').eq(i).animate({left:left,top:top},1000); } To draw circle,
x = tx + r cos(t)
y = ty + r sin(t)
so looping through t value from 0 to 360 will generate circle

for (var i = 0; i < 360; i++) { r = 150; var left = 400 + r*Math.cos(i); var top = 200 + r*Math.sin(i); $('div').eq(i)…

Custom Select Box with new approach

This is my new JQuery plugin for replacing select box. I have tried to implement some cool features which makes it easy to implement and you can play with it as like the native one.

Your suggestions, issues are welcome, so that I can improve this plugin

DEMOFork this on GitHub Implementation: Step 1: include css and scripts in head section<link href="customselectbox.css" rel="stylesheet" type="text/css"></link> <script src=""></script> <script src="customselectbox.js"></script> Step 2: initialize customselect box$(document).ready(function(){ $('select').customSelect(); }); Features:Support thumbnails within optionSearch optionSet and Get value with normal JQuery method. No need to process or query the generated new select box, you can use the ref of the native select box.
//set value $('#myselect').val(value); //get value $('#mysele…