简体   繁体   English

如何根据内容设置Socialengine中smoothbox的自动宽度和高度?

[英]How to set auto width and height of smoothbox in Socialengine based on content?

I am trying to change the width and height of smoothbox popup which in fact is the iframe. 我正在尝试更改实际上是iframe的Smoothbox弹出窗口的宽度和高度。 The traditional way of setting iframes width ain't working because of TB_Overlay. 由于TB_Overlay,设置iframe宽度的传统方法无法正常工作。

I had just tried CSS way as listed below but not really as flexible as a normal iframe. 我刚刚尝试了下面列出的CSS方式,但实际上不像普通的iframe那样灵活。

I have added no conflict and used jquery. 我没有添加冲突并使用了jQuery。

 var $j = jQuery.noConflict();
 $j('#TB_window').css('width','800px');
 document.getElementById("TB_iframeContent").width = "800";

Is there any better way to set the smoothbox width and height? 有没有更好的方法来设置Smoothbox的宽度和高度? Hope many are looking for answer. 希望许多人正在寻找答案。

Thanks in advance 提前致谢

jquery will not work in iframe. jQuery在iframe中不起作用。 It would be easy if you add new CSS according to the particular page 如果根据特定页面添加新的CSS,这将很容易

#page_id .particular_div_class #TB_windowcss
{
'width':'800px' !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM