Mic*_*ael 4 jquery-ui google-chrome-extension
将 jquery-ui(css 和 js) 和 jquery 放入清单后,我可以使用 jq 选择器 ($),但是 jquery-ui 似乎无法访问。例如,我试图在内容脚本 (content_script.js) 中插入一个可调整大小的 div:
var $div = document.createElement('div');
$div.id = 'divId';
$div.innerHTML = 'inner html';
$("body").append($div);//works without error
$("#divId").css("background-color","yellow");//works
//doesn't give resizable handles, however works in a regular html file:
$("#divId").resizable();
//however this also has issue:
document.getElementById("divId").style.resize = "both";
Run Code Online (Sandbox Code Playgroud)
显现:
"css":["jquery-ui.css"],
"js": ["jquery-ui.js","jquery.js","content_script.js"]
Run Code Online (Sandbox Code Playgroud)
错误的加载顺序 -jquery-ui希望jquery首先加载。
"js": ["jquery.js", "jquery-ui.js", "content_script.js"]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
731 次 |
| 最近记录: |