日期:2014-05-16  浏览次数:20306 次

jquery 点击文本框,弹出window,此时文本框不能继续输入
JScript code

$('#textId').live('click',function(){
    $('#window').focus();
    
    $('#window').window({
        title: 'newwindow',
        width: 300,
        height: 300,
        modal: true,
        shadow: true,
        closed: false,
        modal:true
    });
});



点击<input id="textId" type="text" size="25" /> 弹出window,但是文本框还是可以继续输入....是我获得的焦点有错吗?

------解决方案--------------------
没有错! 获取焦点 return false;
------解决方案--------------------
$('#textId').blur();
------解决方案--------------------
$('#textId').live('click',function(){

$('#window').window({
title: 'newwindow',
width: 300,
height: 300,
modal: true,
shadow: true,
closed: false,
modal:true
});

$('#window').focus();// 加到这里来
// 不行的话在试试下面这句
// $(this).blur();

});