html - Autofocus won't apply to input box -


i'm trying autofocus input box, that's appears when 'get started' pressed:

<input name="hex" type="search" autofocus="autofocus"> 

however, after applying autofocus="autofocus"> in input doesn't apply.

i have tried give input id , used jquery:

$('input').focus(); 

but again, does't seem apply, can help?

live example

basically happening is focusing though when click button unfocuses when overlay comes down when on no longer focused.

the way round add:

$('input').focus(); 

when animation of overlay coming down on button click

change contents of demo1.js this:

(function() {     var triggerbttn = document.getelementbyid( 'trigger-overlay' ),         overlay = document.queryselector( 'div.overlay' ),         closebttn = overlay.queryselector( 'button.overlay-close' );         transendeventnames = {             'webkittransition': 'webkittransitionend',             'moztransition': 'transitionend',             'otransition': 'otransitionend',             'mstransition': 'mstransitionend',             'transition': 'transitionend'         },         transendeventname = transendeventnames[ modernizr.prefixed( 'transition' ) ],         support = { transitions : modernizr.csstransitions };      function toggleoverlay() {         if( classie.has( overlay, 'open' ) ) {             classie.remove( overlay, 'open' );             classie.add( overlay, 'close' );             var onendtransitionfn = function( ev ) {                 if( support.transitions ) {                     if( ev.propertyname !== 'visibility' ) return;                     this.removeeventlistener( transendeventname, onendtransitionfn );                 }                 classie.remove( overlay, 'close' );             };             if( support.transitions ) {                 overlay.addeventlistener( transendeventname, onendtransitionfn );             }             else {                 onendtransitionfn();             }         }         else if( !classie.has( overlay, 'close' ) ) {             classie.add( overlay, 'open' );             $('input').focus();         }     }     triggerbttn.addeventlistener( 'click', toggleoverlay );     closebttn.addeventlistener( 'click', toggleoverlay ); })(); 

Comments

Popular posts from this blog

python 3.x - Mapping specific letters onto a list of words -

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -