欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

html組件不可輸入(只讀)同時任何組件都有效

 更新時間:2013年04月01日 09:05:34   作者:  
在開發(fā)過程中經(jīng)常會碰到讓html組件不可輸入(只讀),任何組件都有效的情況,接下來將為大家詳細實現(xiàn)下,感興趣的朋友可以參考下哈
復制代碼 代碼如下:

/**
* 將頁面設置為只讀
*/
var setReadOnly = function()
{
var input = $("input");
input.each(function(i)
{
$(this).attr("onfocus", "this.blur();return false;");
$(this).wrap(function()
{
return '<span onmousemove="this.setCapture();" onmouseout="this.releaseCapture();" />';
});
});
var select = $("select");
select.each(function(i)
{
$(this).attr("onfocus", "this.blur();return false;");
$(this).wrap(function()
{
return '<span onmousemove="this.setCapture();" onmouseout="this.releaseCapture();" />';
});
});
var textarea = $("textarea");
textarea.each(function(i)
{
$(this).attr("onfocus", "this.blur();return false;");
$(this).wrap(function()
{
return '<span onmousemove="this.setCapture();" onmouseout="this.releaseCapture();" />';
});
});
var img = $("img");
img.each(function(i)
{
$(this).attr("onfocus", "this.blur();return false;");
$(this).wrap(function()
{
return '<span onmousemove="this.setCapture();" onmouseout="this.releaseCapture();" />';
});
});
}

相關文章

最新評論