Author:
erics , December 2nd, 2021
Use AutoRaise! From the docs: “When you hover a window it will be raised to the front (with a delay of your choosing) and gets the focus.” Web page: https://github.com/sbmpost/AutoRaise Download: https://github.com/sbmpost/AutoRaise/archive/refs/heads/master.zip
unzip - d ~ ~ / Downloads / AutoRaise - master . zip
cd ~ / AutoRaise - master && make clean && make
make install
My ~/.AutoRaise file:
#AutoRaise config file
delay = 3
Categories: How-To's , Technology Tags: apple , AutoRaise , Delay , Focus , Focus Follows Mouse , Follow , Hover , howto , Mac , MacOS , macosx , Mouse , Raise , tips , window
| 1 comment
Author:
erics , September 5th, 2017
Set browser.autofocus to false in about:config
Categories: How-To's , Technology Tags: about:config , AutoFocus , Browser , browser.autofocus , Config , configure , Firefox , Focus , New Tab , search , Tab , URL
| No comments
Author:
erics , June 19th, 2012
jQuery
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var self = this ;
self . Dialog = jQuery ( '#yourDialog' ) ;
if ( self . Dialog . length ) {
self . Dialog . dialog ( {
autoOpen : false ,
title : 'Your Dialog Title Here' ,
position : [ 'center' , 200 ] ,
minWidth : 400 ,
modal : true ,
focus : function ( ) {
jQuery ( ':input' , this ) . keyup ( function ( event ) {
if ( event . keyCode == 13 ) {
self . Dialog . parent ( ) . find ( 'div.ui-dialog-buttonpane button.primary' ) . click ( ) ;
}
} ) ;
} ,
open : function ( evt , ui ) {
jQuery ( '#Loader-ajax' ) . load ( '/get_dialog_form_content.php' ) ;
} ,
buttons : {
"Cancel" : {
'text' : 'Cancel' ,
'class' : 'cancel' ,
'click' : function ( ) {
jQuery ( this ) . dialog ( "close" ) ;
}
} ,
"Continue" : {
'text' : 'Continue' ,
'class' : 'primary' ,
'click' : function ( ) {
jQuery ( "#Form-edit" ) . submit ( ) ;
} // end click
} // end Continue button
} // end buttons
} ) ; // end self.Dialog.dialog
// bind the triggering link
jQuery ( "a.yourTrigger" ) . live ( 'click' , function ( e ) {
jQuery ( ".ui-dialog-content" ) . dialog ( "close" ) ;
self . Dialog . dialog ( 'open' ) ;
return false ;
} ) ;
}
HTML
< div id = "yourDialog" class = "hide" >
< form id = "Form-edit" action = "/index.php" method = "POST" >
< input type = "hidden" name = "action" value = "save" >
< div id = "Loader-ajax" class = "clearfix" > < img src = "//www.ericmichaelstone.com/wp-content/uploads/2013/02/ajax-loader.gif" alt = "Please Wait..." / > < / div >
< / form >
< / div >
Categories: How-To's , Technology Tags: Dialog , Enter , Enter key , Focus , howto , JQuery , jQuery UI , Modal , tips , UI
| No comments
Author:
erics , September 20th, 2011
Here is a VERY simplistic watermark code snippet. It has the distinct disadvantage of submitting the watermark string as the field value, and does not set the initial field value either…YMMV…
jQuery ( '#yourInput' )
. focusin ( function ( ) {
if ( jQuery ( '#yourInput' ) . val ( ) == 'Enter keywords to search for' ) jQuery ( '#yourInput' ) . val ( '' ) ;
} )
. focusout ( function ( ) {
if ( jQuery ( '#yourInput' ) . val ( ) == '' ) jQuery ( '#yourInput' ) . val ( 'Enter keywords to search for' ) ;
} ) ;
http://api.jquery.com/focusin/
Categories: How-To's , Technology Tags: Focus , focusin , focusout , form , Form field , howto , ID , input , Input field , JQuery , tips , val() , Water Mark , Watermark
| No comments
Author:
erics , June 10th, 2011
jQuery ( 'form :input:visible:enabled:first' ) . focus ( ) ;
Categories: How-To's , Technology Tags: first , First form element , Focus , form , howto , JQuery , tips
| No comments
Author:
erics , May 17th, 2011
Important Note: This solution REQUIRES jQuery 1.6 or better due to the addition of the :focus selector! Here is how I used it for a form in a jQuery UI dialog:
var Info = jQuery ( this ) . find ( ':focus' ) . get ( 0 ) . tagName ;
if ( tagName == 'INPUT' ) return false ;
Categories: How-To's , Technology Tags: Element , Focus , Focused , howto , javascript , JQuery , selected , tagName , tips
| No comments
Author:
erics , April 17th, 2011
As of jQuery 1.4.1 .live() can accept multiple, space-separated events, similar to the functionality provided in .bind(). For example, we can “live bind” the click and focus events at the same time like so:
jQuery ( '.datepick' ) . live ( 'click focus' , function ( ) {
jQuery ( this ) . datepicker ( 'destroy' ) . datepicker ( { showOn : 'both' } ) ;
} ) ;
Another example, this time creating a hover effect:
jQuery ( '.rollover' ) . live ( 'mouseover mouseout' , function ( event ) {
if ( event . type == 'mouseover' ) {
// do something on mouseover
} else {
// do something on mouseout
}
} ) ;
Categories: How-To's , Technology Tags: bind , click , datepicker , Events , Focus , JQuery , live , mouseout , mouseover , Multiple events , rollover
| No comments
Author:
erics , November 22nd, 2010
jQuery(‘#theDiv :input:text:first’).focus();
Categories: How-To's , Technology Tags: Focus , howto , JQuery , tips
| No comments