Saturday, October 6, 2012

Use mouseenter/mouseleave instead of mouseover / mouseout events


The problem:

When you have mouseover and mouseout events bound to some element on you page with children elements. Hovering over children element fires parent’s mouseover and/ormouseout event.

The solution:

The solution to this error is to use mouseenter and mouseleave events instead ofmouseover and mouseout.

The reason:

This solution works because mouseover and mouseout events do not bubble from child to parent element.

Source and credit goes to:  http://jquery-howto.blogspot.in/
   http://jquery-howto.blogspot.in/2009/04/problems-with-jquery-mouseover-mouseout.html

Wednesday, September 19, 2012

single click call function in two times while using jquery live

The below code solve ur problem......

$('selector').die();
$
('selector').live('event', myLiveEventHandler);


Credit goes to : http://sholsinger.com/archive/2011/08/prevent-jquery-live-handlers-from-firing-multiple-times/

Monday, June 25, 2012

CK Editor Config sample


Source From : http://stackoverflow.com/questions/4305929/how-can-i-disable-save-button-in-ckeditor

CKEDITOR.editorConfig = function( config )
{
    // Define changes to default configuration here. For example:
    // config.language = 'fr';

    config.uiColor = '#F6F6F6';
    config.fontSize_sizes = '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;15/15px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px' ;
    config.forcePasteAsPlainText = true;
    config.format_tags = 'p;h2;h3;h4;h5;h6;pre;div'
    config.height = "400px";
    // config.protectedSource.push( //g ); // Allows PHP Code
    // config.shiftEnterMode = CKEDITOR.ENTER_BR;
    config.skin = 'kama';
    config.undoStackSize = 90;
    config.width = "98%";

    config.disableNativeSpellChecker = false;
    config.scayt_autoStartup = false;

    config.toolbarCanCollapse = false;
    config.toolbar = 'Cms';
    config.toolbar_Cms =
    [
        ['Source'],
        ['Cut','Copy','Paste','PasteText','PasteFromWord'],
        ['Undo','Redo','-','SelectAll','RemoveFormat'],
        ['Image','Table','SpecialChar'],
        '/',
        ['Bold','Italic','-','Subscript','Superscript'],
        ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
        ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
        ['Link','Unlink','Anchor'],
        '/',
        ['Styles','Format','FontSize'],['TextColor'],['Maximize', 'ShowBlocks']
    ];
};