1
The original image is this: http://4k.com/wp-content/uploads/2014/06/4k-image-tiger-jumping.jpg
I’m wearing event click
to call function "toggleFullscreen".
Follows the code:
Html:
<img id="image" width="450" height="350" src="http://4k.com/wp-content/uploads/2014/06/4k-image-tiger-jumping.jpg">
Script
<script type="text/javascript">
$("#image").click(function() {
toggleFullscreen(this);
});
function toggleFullscreen(elem) {
elem = elem || document.documentElement;
if (!document.fullscreenElement && !document.mozFullScreenElement &&
!document.webkitFullscreenElement && !document.msFullscreenElement) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
}
</script>
Problem: After clicking on the image, the image remains the same size as img tag. It is not leaving the original image like this: http://4k.com/wp-content/uploads/2014/06/4k-image-tiger-jumping.jpg in full screen.
Here it is in jsfiddle: https://jsfiddle.net/j1fxt7ct/1/
Some solution ?
For me it was full screen :/
– BrTkCa
here this working perfectly, the jsfiddle left fullscreen yes.
– RFL
Calm down, I’ll print it out and send it to you
– Matheus Miranda
https://s27.postimg.org/emjmufspf/05_Dec_30_16_22.jpg
– Matheus Miranda
She left fullscreen yes, but the image of the tiger no
– Matheus Miranda
The problem is this: width="450" height="350", is making the image small.
– Matheus Miranda
I tested and the image was
fullscreen
, is not some configuration of your browser? Open inFirefox
– JcSaint
Jeez because the problem is google Chrome ? The rest is ok
– Matheus Miranda
The tiger was fellscreen for me, I’m also using firefox @Matheusmiranda. Try it with another browser.
– BrTkCa
Firefox worked without problem.
– mau humor
Yes, @mauhumor, the problem is google Chrome
– Matheus Miranda