Calling javascript function on the Mousehoever and mouseout using jQuery

Posted by Wazdesign on Stack Overflow See other posts from Stack Overflow or by Wazdesign
Published on 2010-05-07T06:30:03Z Indexed on 2010/05/07 6:38 UTC
Read the original article Hit count: 362

Filed under:
|
|

I want to call the javascript function using mousehover jQuery event.

Here is the one function.

// On mouse hover function     
 function ShowHighlighter(d, highlight_elid) {
            //alert ("ShowHighlighter\n"+d);
            if (d == "addHighlight") {
                var txt = getSelText();
                if (txt.length < 1)
                {
                    return;
                }
                ShowContent(d);
            } else if (d == "deleteHighlight") {
                var elid = "#"+d;
                jQuery(elid).stop();
                ShowContent(d);
                delete_highlight_id = "#"+highlight_elid;
            }
        }


//   on Mouse out function
 function HideContent(d) {
        if(d.length < 1) { return; }    
        document.getElementById(d).style.display = "none";
    }

I am trying to use this function ... but it not seems to be working.

jQuery('a[href="HIGHLIGHT_CREATELINK"]').mouseover(ShowHighlighter("deleteHighlight","highlight"+ randomCount + ");) ;
       jQuery('a[href="HIGHLIGHT_CREATELINK"]').mouseout('javascript:HideContentFade(\"deleteHighlight\");') 

please help me out in this.

thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript