I want to run a psychological study for which participants have to look at large images.
The experiment is done on the web and therefore in a browser window. Is it p
I have found some code after searching.
function fullscreen() {
var element = document.getElementById("content");
if (element.requestFullScreen) {
if (!document.fullScreen) {
element.requestFullscreen();
$(".fullscreen").attr('src',"img/icons/panel_resize_actual.png");
} else {
document.exitFullScreen();
$(".fullscreen").attr('src',"img/icons/panel_resize.png");
}
} else if (element.mozRequestFullScreen) {
if (!document.mozFullScreen) {
element.mozRequestFullScreen();
$(".fullscreen").attr('src',"img/icons/panel_resize_actual.png");
google.maps.event.trigger(map, 'resize');
} else {
document.mozCancelFullScreen();
$(".fullscreen").attr('src',"img/icons/panel_resize.png");
}
} else if (element.webkitRequestFullScreen) {
if (!document.webkitIsFullScreen) {
element.webkitRequestFullScreen();
$(".fullscreen").attr('src',"img/icons/panel_resize_actual.png");
google.maps.event.trigger(map, 'resize');
} else {
document.webkitCancelFullScreen();
$(".fullscreen").attr('src',"img/icons/panel_resize.png");
}
}
}
It will use html5 api. I switch with jquery the a special picture for it. Hope that will help out. At the moment, i don't know if you can force it, 'cause it was forbitten due security.
You could just tell the user to press F11. Next to it, put a 'why?' link and explain why you feel like they need to be in fullscreen mode.
I don't think you can force a browser to go full screen and, in fact, if you were able to do that I'd be furious at my browser. It's too invasive. Even Flash has security so that forcing the plugin to go to fullscreen requires the event to originate with a user interaction. So, if it's that important to you, this might be a good reason to use the Flash plugin because you could attach the go-fullscreen call to a misleading button that says 'start quiz' (or whatever).
But, please don't do that. Just be straight forward with the user and tell them to hit F11.
EDIT: I just tried the sample code provided in another comment and I'm happy to say that Firefox opens up a maximized window with an address bar, not a fullscreen window.
There isn't a way to resize the current window to full screen, but you can open a popup in full screen:
<script type="text/javascript">
<!--
function popup(url)
{
params = 'width='+screen.width;
params += ', height='+screen.height;
params += ', top=0, left=0'
params += ', fullscreen=yes';
newwin=window.open(url,'windowname4', params);
if (window.focus) {newwin.focus()}
return false;
}
// -->
</script>
<a href="javascript: void(0)"
onclick="popup('popup.html')">Fullscreen popup window</a>
To modify the parent window, try something like:
window.opener.location.href = '/confirmation/page.html';
Open a new window in full screen mode on IE:
<script>
<!--
window.open("page.html","fs","fullscreen,scrollbars")
//-->
</script>
Putting in a "Close" link on page.html may be a good idea:
<a href="#" onclick="window.close()">Close Window</a>
In the past, I've seen websites do this. However, as it's incredibly annoying and generally used by ads for pr0n websites, the technique may be blocked in recent browsers.
But I think the important point is: it's incredibly annoying and generally used by ads for pr0n websites, so you probably don't want to associate yourself which such things, so your probably best off just asking your users to maximize their browsers.