Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  32] [ 2]  / answers: 1 / hits: 27183  / 15 Years ago, sun, june 21, 2009, 12:00:00

I have a google map integrated on part of my page. I would like to create a toggle button to toggle the map between full screen and normal size. So when you click on it - the map extends to fill the whole browser screen, and click on it again, it is restored to its original size on the page. How would I do it?


More From » google-maps

 Answers
26

Here's a jQuery implementation.



$(#map_toggler).click(function() {
$(#map).toggleClass(fullscreen)
});


In the CSS:



#map {
width: 400px;
height: 200px;
}

#map.fullscreen {
position: fixed;
width:100%;
height: 100%;
}


Untested, but something along the lines of that should work.


[#99272] Tuesday, June 16, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arturo

Total Points: 331
Total Questions: 99
Total Answers: 92

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
arturo questions
;