0

嗨,我有这个 JS 代码

function openPopup(url)
{

    var newElem = new Element( 'div' );
    newElem.setAttribute('rel','handler');
    newElem.setAttribute('class','modal');
    SqueezeBox.setContent( 'adopt', newElem );
    SqueezeBox.setContent( 'iframe', url);

}

这会打开一个带有给定 URL 的弹出窗口。我想更改 SqueezeBox 的大小怎么做?

4

1 回答 1

1

请尝试 SqueezeBox.resize({x: 350, y: 400});

当然,您还必须调整内容的大小,如

SqueezeBox.initialize({
    size: {x: 350, y: 400}
});

var newElem = new Element( 'div' );
newElem.appendText("Some Text");
newElem.setStyle('border', 'solid 2px black');
newElem.setStyle('width', '300px');
SqueezeBox.setContent('adopt', newElem);

SqueezeBox.resize({x: 750, y: 400})
newElem.setStyle('width', '700px'); 
于 2011-06-08T08:55:40.350 回答