jQuery(document).ready(function($) { // Color Picker $('.colorSelector').each(function(){ var Othis = this; //cache a copy of the this variable for use inside nested function var initialColor = $(Othis).next('input').attr('value'); $(this).ColorPicker({ color: initialColor, onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; }, onHide: function (colpkr) { $(colpkr).fadeOut(500); return false; }, onChange: function (hsb, hex, rgb) { $(Othis).children('div').css('backgroundColor', '#' + hex); $(Othis).next('input').attr('value','#' + hex); } }); }); //end color picker $(".CloseButton").click(function() { if (parseInt($("#MiniPanel").css("left")) < 0) { $(this).html("<"); $("#MiniPanel").animate({left: 0}, 300, "easeInOutExpo"); } else { $(this).html(">"); $("#MiniPanel").animate({left: -290}, 300, "easeInOutExpo"); } }); });