में समायोजित करने के लिए ऐस संपादक कैसे प्राप्त करें मेरे पास एक और div के अंदर ऐस div है और मैं एसी संपादक को पैर की div पर इसकी चौड़ाई और ऊंचाई समायोजित करना चाहता हूं। मैं editor.resize() को कॉल करता हूं लेकिन कुछ भी नहीं होता है।अपने पैरेंट div
<!DOCTYPE html>
<html lang="en" style="height: 100%">
<head>
<title>ACE in Action</title>
<style type="text/css" media="screen">
#editor {
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100px;
}
</style>
</head>
<body style="height: 100%">
<div style="background-color: red; height: 100%; width: 100%;">
<div id="editor">function foo(items) {
var x = "All this is syntax highlighted";
return x;
}</div>
</div>
<script src="ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
editor.resize();
</script>
</body>
</html>
आपका तर्क ऊंचाई नहीं बल्कि चौड़ाई समायोजित करता है। सही? –
ऊंचाई और चौड़ाई दोनों समायोजित किया जाना चाहिए। ऊंचाई और चौड़ाई दोनों पर 100% यही है। – scain