admin管理员组文章数量:1277885
I want to open popup window using javascript with no title and address bar and also want to set its height and width in percentage according to screen resolution.How can i achieve this. I did this code;
function popitup(url) {
LeftPosition = (screen.width) ? (screen.width - 800) / 2 : 0;
TopPosition = (screen.height) ? (screen.height - 700) / 2 : 0;
var sheight = (screen.height) * 0.9;
var swidth = (screen.width) * 0.8;
settings = 'height='+ sheight + ',width='+ swidth + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,resizable=yes,toolbar=no,status=no,menu=no, directories=no,titlebar=no,location=no,addressbar=no'
newwindow = window.open(url, '', settings);
if (window.focus) { newwindow.focus() }
return false;
}
but still i can see address and title bar.Is this is relative versions and type of browser?.If so how can i achieve these settings in latest versions of browser like IE9,Chrome,Firefox and safari?
I want to open popup window using javascript with no title and address bar and also want to set its height and width in percentage according to screen resolution.How can i achieve this. I did this code;
function popitup(url) {
LeftPosition = (screen.width) ? (screen.width - 800) / 2 : 0;
TopPosition = (screen.height) ? (screen.height - 700) / 2 : 0;
var sheight = (screen.height) * 0.9;
var swidth = (screen.width) * 0.8;
settings = 'height='+ sheight + ',width='+ swidth + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,resizable=yes,toolbar=no,status=no,menu=no, directories=no,titlebar=no,location=no,addressbar=no'
newwindow = window.open(url, '', settings);
if (window.focus) { newwindow.focus() }
return false;
}
but still i can see address and title bar.Is this is relative versions and type of browser?.If so how can i achieve these settings in latest versions of browser like IE9,Chrome,Firefox and safari?
Share Improve this question edited Nov 1, 2012 at 13:52 Piyush-Ask Any Difference 4,2865 gold badges50 silver badges94 bronze badges asked Nov 1, 2012 at 10:08 swapnilswapnil 811 gold badge3 silver badges10 bronze badges2 Answers
Reset to default 4For security reasons, this is not possible.
Check out http://www.codeproject./Questions/79625/How-to-hide-title-bar-in-Javascript-popup
You may use alternatives like modal dialogs which more appealing. Most JS libraries provide modal dialogs out of the box or by using plugins.
Is it supposed to be menu = no
or menubar = no
??
settings = 'width='+w+',height='+h+',top='+top+', left='+left+',menubar=no,resizable=no,scrollbars=yes,location=no,toolbar=no'
worked fine for me.
本文标签:
版权声明:本文标题:jquery - Opening javascript popup window without address bar and title with height and width set in percentage according to scre 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741223064a2361338.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论