[]
Sheets.FloatingObjects.Picture
↳ Picture
• new Picture(name
, src
, x
, y
, width
, height
)
图片
属性名 | 类型 | 说明 |
---|---|---|
name |
string |
图片名称 |
src |
string |
图片的图像来源 |
x |
number |
图片的x位置 |
y |
number |
图片的y位置 |
width |
number |
图片的宽度 |
height |
number |
图片的高度 |
• typeName: string
支持序列化的类型名称字符串
▸ allowMove(value?
): any
获取或设置是否禁用移动浮动对象元素
代码示例
//本示例阻止您移动或调整浮动对象元素的大小
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
boolean |
是否禁用移动浮动对象元素的设置 |
any
如果未设置任何值,则返回是否禁用移动浮动对象元素的设置;否则,返回浮动对象元素
▸ allowResize(value?
): any
获取或设置是否禁用调整浮动对象的大小
代码示例
//本示例阻止您移动或调整浮动对象元素的大小
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
boolean |
是否禁用调整浮动对象大小的设置 |
any
如果未设置任何值,则返回是否禁用调整浮动对象大小的设置;否则,返回浮动对象
▸ alt(value?
): any
获取或设置浮动对象的可选文本
代码示例
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
customFloatingObject.alt("A button");
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
string |
浮动对象的可选文本 |
any
浮动对象的可选文本
▸ backColor(value?
): any
获取或设置图片的背景色
代码示例
//This example sets the backcolor of the picture.
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("solid");
picture.borderWidth(2);
picture.borderColor("red");
属性名 | 类型 | 说明 |
---|---|---|
value? |
string |
图片的背景色 |
any
如果未设置任何值,则返回图片的背景色.否则,返回图片
▸ borderColor(value?
): any
获取或设置图片的边框颜色
代码示例
//This example sets the border color of the picture.
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("solid");
picture.borderWidth(2);
picture.borderColor("red");
属性名 | 类型 | 说明 |
---|---|---|
value? |
string |
图片的边框颜色 |
any
如果未设置任何值,则返回图片的边框颜色.否则,返回图片
▸ borderRadius(value?
): any
获取或设置图片的边框圆角半径
代码示例
//本示例使用borderRadius方法
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.backColor("blue");
picture.borderWidth(2);
picture.borderColor("red");
picture.borderStyle("dotted");
picture.borderRadius(5);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
图片的边框圆角半径 |
any
如果未设置任何值,则返回图片的边框圆角半径.否则,返回图片
▸ borderStyle(value?
): any
获取或设置图片的边框样式
代码示例
//This example uses the borderStyle method.
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("dotted");
picture.borderWidth(2);
picture.borderColor("red");
属性名 | 类型 | 说明 |
---|---|---|
value? |
string |
图片的css边框样式,如点线,虚线,实线等 |
any
如果未设置任何值,则返回图片的边框样式.否则,返回图片
▸ borderWidth(value?
): any
获取或设置图片的边框宽度
代码示例
//This example uses the borderWidth method.
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("solid");
picture.borderWidth(2);
picture.borderColor("red");
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
图片的边框宽度 |
any
如果未设置任何值,则返回图片的边框宽度.否则,返回图片
▸ cloneContent(): HTMLElement
获取当前实例的内容副本
代码示例
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 64, 30);
customFloatingObject.content(createButton('button 1', '64px', '30px'));
activeSheet.floatingObjects.add(customFloatingObject);
var btn = customFloatingObject.cloneContent();
btn.innerText = 'button 2';
customFloatingObject.content(btn);
function createButton (text, width, height) {
var btn = document.createElement('button');
btn.style.width = width;
btn.style.height = height;
btn.innerText = text;
return btn;
}
HTMLElement
当前实例内容的副本
▸ content(value?
): any
获取或设置自定义浮动对象元素的内容
代码示例
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 64, 30);
customFloatingObject.content(createButton('button 1', '64px', '30px'));
activeSheet.floatingObjects.add(customFloatingObject);
console.log(customFloatingObject.content()); // get current content, the result is button element with the text "button 1".
customFloatingObject.content(createButton('button 2', '64px', '30px')); // set new content.
function createButton (text, width, height) {
var btn = document.createElement('button');
btn.style.width = width;
btn.style.height = height;
btn.innerText = text;
return btn;
}
属性名 | 类型 | 说明 |
---|---|---|
value? |
HTMLElement |
自定义浮动对象元素的内容 |
any
如果未设置任何值,则返回自定义浮动对象元素的内容;否则,返回浮动对象元素
▸ dynamicMove(value?
): any
获取或设置对象在隐藏或显示,调整大小或移动行或列时是否移动
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
boolean |
该值指示对象在隐藏或显示,调整大小或移动行或列时是否移动 |
any
如果未设置任何值,则返回此浮动对象元素是否动态移动;否则,返回浮动对象元素
▸ dynamicSize(value?
): any
获取或设置在隐藏或显示,调整大小或移动行或列时对象的大小是否改变
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
boolean |
该值指示在隐藏或显示,调整大小或移动行或列时对象的大小是否改变 |
any
如果未设置任何值,则返回此浮动对象元素是否动态更改大小;否则,返回浮动对象元素
▸ endColumn(value?
): any
获取或设置浮动对象元素位置的结束列索引
代码示例
//Creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//Position the upper left corner of the floating object by cell anchors.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//Position the lower right corner of the floating object by cell anchors.
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
浮动对象元素位置的结束列索引 |
any
如果未设置任何值,则返回浮动对象元素位置的结束列索引;否则,返回浮动对象元素
▸ endColumnOffset(value?
): any
获取或设置相对于浮动对象元素的结束列的偏移量
代码示例
//Creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//Position the upper left corner of the floating object by cell anchors.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//Position the lower right corner of the floating object by cell anchors.
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
相对于浮动对象元素的结束列的偏移量 |
any
如果未设置任何值,则返回相对于浮动对象元素的结束列的偏移量;否则,返回浮动对象元素
FloatingObject.endColumnOffset
▸ endRow(value?
): any
获取或设置浮动对象元素位置的末行索引
代码示例
//Creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//Position the upper left corner of the floating object by cell anchors.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//Position the lower right corner of the floating object by cell anchors.
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
浮动对象元素位置的末行索引 |
any
如果未设置任何值,则返回浮动对象元素位置的末端行索引;否则,返回浮动对象元素
▸ endRowOffset(value?
): any
获取或设置相对于浮动对象元素的最后一行的偏移量
代码示例
//Creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//Position the upper left corner of the floating object by cell anchors.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//Position the lower right corner of the floating object by cell anchors.
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
相对于浮动对象元素的最后一行的偏移量 |
any
如果未设置任何值,则返回相对于浮动对象元素的最后一行的偏移量;否则,返回浮动对象元素
▸ fixedPosition(value
): any
获取或设置浮动对象元素的位置是否固定 当fixedPosition为true时,dynamicMove和dynamicSize被禁用
代码示例
//本示例将对象的位置设置为固定
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.fixedPosition(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value |
boolean |
该值指示浮动对象元素的位置是否固定 |
any
如果未设置任何值,则返回浮动对象元素的位置是否固定 否则,返回浮动对象元素
▸ getHost(): HTMLElement
[]
获取自定义内容的dom宿主
HTMLElement
[]
▸ getOriginalHeight(): number
获取图片的原始高度
代码示例
activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
//button
$("#button1").click(function () {
alert(picture.getOriginalHeight());
});
number
图片的原始高度
▸ getOriginalWidth(): number
获取图片的原始宽度
代码示例
activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
//button
$("#button1").click(function () {
alert(picture.getOriginalWidth());
});
number
图片的原始宽度
▸ height(value?
): any
获取或设置浮动对象元素的高度
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
浮动对象元素的高度 |
any
如果未设置任何值,则返回一个浮动对象元素的高度;否则,返回浮动对象元素
▸ isLocked(value?
): any
获取或设置此浮动对象元素是否被锁定
代码示例
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
customFloatingObject.isLocked(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
activeSheet.options.isProtected = true;
属性名 | 类型 | 说明 |
---|---|---|
value? |
boolean |
该值指示此浮动对象元素是否被锁定 |
any
如果未设置任何值,则返回此浮动对象元素是否被锁定;否则,返回浮动对象元素
▸ isSelected(value?
): any
获取或设置是否选择此浮动对象元素
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isSelected(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
boolean |
该值指示此浮动对象元素是否被选择 |
any
如果未设置任何值,则返回是否选择此浮动对象元素;否则,返回浮动对象元素
▸ isVisible(value?
): any
获取或设置此浮动对象元素是否可见
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
boolean |
该值指示此浮动对象元素是否可见 |
any
如果未设置任何值,则返回此浮动对象元素是否可见;否则,返回浮动对象元素
▸ name(value?
): any
获取浮动对象元素的名称
代码示例
//本示例使用name方法
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject();
customFloatingObject.name("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
string |
浮动对象元素的名称 |
any
如果未设置任何值,则返回浮动对象元素的名称;否则,返回浮动对象元素
▸ pictureStretch(value?
): any
获取或设置图片的拉伸程度
代码示例
//This example uses the pictureStretch method.
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.stretch);
picture.backColor("blue");
属性名 | 类型 | 说明 |
---|---|---|
value? |
ImageLayout |
图片的拉伸程度 |
any
如果未设置任何值,则返回图片的拉伸程度;否则,返回图片
▸ refreshContent(): void
刷新floatObject中的内容用户应重写此方法,以使其内容与floatObject同步
void
▸ src(value?
): any
获取或设置图片的src
代码示例
var pic = sheet.pictures.add("Picture 1", "Event.png", 100, 50, 200, 200);
var src = pic.src(); // get current image source, the result is "Event.png".
pic.src("tsoutline.png"); // set new image source.
属性名 | 类型 | 说明 |
---|---|---|
value? |
string |
图片的src |
any
如果未设置任何值,则返回图片的src 否则,返回图片
▸ startColumn(value?
): any
获取或设置浮动对象元素位置的起始列索引
代码示例
//Creates a floating object.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//Position the upper left corner of the floating object by cell anchors.
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
浮动对象元素位置的起始列索引 |
any
如果未设置任何值,则返回浮动对象元素位置的起始列索引;否则,返回浮动对象元素
▸ startColumnOffset(value?
): any
获取或设置相对于浮动对象元素的起始列的偏移量
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//加入表中时生效
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
相对于浮动对象元素的起始列的偏移量 |
any
如果未设置任何值,则返回相对于浮动对象元素的起始列的偏移量;否则,返回浮动对象元素
FloatingObject.startColumnOffset
▸ startRow(value?
): any
获取或设置浮动对象元素位置的起始行索引
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//加入表中时生效
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
动对象元素位置的起始行索引 |
any
如果未设置任何值,则返回浮动对象元素位置的起始行索引;否则,返回浮动对象
▸ startRowOffset(value?
): any
获取或设置相对于浮动对象元素的起始行的偏移量
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//加入表中时生效
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
相对于浮动对象元素的起始行的偏移量 |
any
如果未设置任何值,则返回相对于浮动对象元素起始行的偏移量;否则,返回浮动对象元素
▸ width(value?
): any
获取或设置浮动对象元素的宽度
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
浮动对象元素的宽度 |
any
如果未设置任何值,则返回一个浮动对象元素的宽度;否则,返回浮动对象元素
▸ x(value?
): any
获取或设置浮动对象元素的水平位置
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
浮动对象元素的水平位置 |
any
如果未设置任何值,则返回浮动对象元素的水平位置;否则,返回浮动对象元素
▸ y(value?
): any
获取或设置浮动对象元素的垂直位置
代码示例
//本示例创建了一个浮动对象
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
属性名 | 类型 | 说明 |
---|---|---|
value? |
number |
获取或设置浮动对象元素的垂直位置 |
any
如果未设置任何值,则返回浮动对象对象的垂直位置;否则,返回浮动对象元素