---
title: "动态设置Ckeditor的尺寸"
author: "hsys"
date: "2010-01-27T11:55:08Z"
tags: []
categories: ["Web前端"]
slug: "ckeditor"
draft: false
lastmod: "2010-01-27T11:55:08Z"
id: 580993
url: "https://hsys.iteye.com/blog/580993"
---

```html


<input type='textarea' id='myText'>

<script>
if(isNaN(w) || isNaN(h)){
	w = 500;
	h = 400;
}
editor = CKEDITOR.replace("myText",{width:w,height:h});
</script>


```


replace后面可以跟配置，传递宽和高进来就可以设置了，不过这里的宽是编辑器的宽，高是指编辑区域和高，不包括上面的工具按钮。