javascript - Unable to set focus to text box after custom popup -


i'm showing fancy box message , after message i'm trying set focus textbox.but not working

here html code

    <a class="fancytrigger" href="#thefancybox"></a> <hr> <div id="thefancybox"></div>  powered <a href="http://fancybox.net/" target="_blank">fancybox</a>      <input id="ipt" type="textbox" /> 

javascript code

    $("#thefancybox").html("<p>just adding paragraph demonstrate can dynamically create html content within div using .html()</p>");  $(".fancytrigger").fancybox(); $(".fancytrigger").trigger('click');  $('#ipt').focus(); 

and here demo jsfiddle

this work fancybox 2.0.

$(".fancytrigger").fancybox({     aftershow : function() {         $('#ipt').focus()     },     afterclose : function() {         $('#ipt').focus()     } }); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -