1 line
2.2 KiB
JSON
1 line
2.2 KiB
JSON
{"name":"focusout","type":"method","title":".focusout()","deprecated":null,"removed":null,"desc":"Bind an event handler to the \"focusout\" JavaScript event.","categories":["events/keyboard-events","events/mouse-events","version/1.4","version/1.4.3"],"entries":[{"return":"jQuery","signatures":[{"added":"1.4","argument":{"desc":"A function to execute each time the event is triggered.","name":"handler(eventObject)","type":"Function"}},{"added":"1.4.3","argument":[{"desc":"An object containing data that will be passed to the event handler.","name":"eventData","type":"Object","optional":"true"},{"desc":"A function to execute each time the event is triggered.","name":"handler(eventObject)","type":"Function"}]}],"examples":{"desc":"Watch for a loss of focus to occur inside paragraphs and note the difference between the <code>focusout</code> count and the <code>blur</code> count. (The <code>blur</code> count does not change because those events do not bubble.)","css":"\n .inputs {\n float: left;\n margin-right: 1em;\n }\n .inputs p {\n margin-top: 0;\n }\n","code":"\nvar focus = 0,\n blur = 0;\n$( \"p\" )\n .focusout(function() {\n focus++;\n $( \"#focus-count\" ).text( \"focusout fired: \" + focus + \"x\" );\n })\n .blur(function() {\n blur++;\n $( \"#blur-count\" ).text( \"blur fired: \" + blur + \"x\" );\n });\n","html":"\n<div class=\"inputs\">\n <p>\n <input type=\"text\"><br>\n <input type=\"text\">\n </p>\n <p>\n <input type=\"password\">\n </p>\n</div>\n<div id=\"focus-count\">focusout fire</div>\n<div id=\"blur-count\">blur fire</div>\n"},"longdesc":"\n <p>This method is a shortcut for <code>.on( \"focusout\", handler )</code> when passed arguments, and <code>.trigger( \"focusout\" )</code> when no arguments are passed.</p>\n <p>The <code>focusout</code> event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the <a href=\"/blur/\">blur</a> event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling).</p>\n <p>This event will likely be used together with the <a href=\"/focusin/\">focusin</a> event.</p>\n "}]} |