问题
For the following code width and height are working in Chrome but location and scrollbar are not working. Please guide.
<script language="JavaScript">
function newwindow() {
window.open('http://localhost/a.php', 'jav',
'width=300,height=200,resizable=yes,location=no,scrollbars=no');
}
</script>
<a href="javascript:newwindow()">Click Here</a>
回答1:
Chrome will not allow you to do this for security reasons. Hiding the address bar makes it easier to pretend you're somebank.com when really you're somenigerianguy.com.
As for the scrollbar, you can use css on a.php
to hide the scrollbars by setting overflow: hidden
.
回答2:
To hide the scrollbar: try setting "overflow: hidden;" in the css
You can't open a popup without location bar like in IE, to workaround this you could use an iframe or some third party jQuery plugin
来源:https://stackoverflow.com/questions/6748246/how-to-disable-location-bar-and-scroll-bars-of-pop-window-in-chrome