wboykinm

fullscreen for map div

Sep 8th, 2011
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.80 KB | None | 0 0
  1. in the links:
  2. ***********************
  3. <script type="text/javascript" src="http://vtirene.crowdmap.com/plugins/fullscreenmap/views/js/jquery.colorbox.js">
  4.  
  5. <link rel="stylesheet" type="text/css" href="http://vtirene.crowdmap.com/plugins/fullscreenmap/views/css/fullscreenmap.css" />
  6. <link rel="stylesheet" type="text/css" href="http://vtirene.crowdmap.com/plugins/fullscreenmap/views/css/colorbox.css" />
  7.  
  8.  
  9. in the header:
  10. ***********************
  11. <script type="text/javascript" charset="utf-8">
  12. //start fullscreen script
  13. $(document).ready(function() {
  14.         var orig_width = $("#map").width();
  15.         var orig_height = $("#map").height();
  16.  
  17.         currZoom = map.getZoom();
  18.         currCenter = map.getCenter();
  19.  
  20.         $(".fullscreenmap_click").colorbox({
  21.                 width:"100%",
  22.                 height:"100%",
  23.                 inline:true,
  24.                 href:"#map",
  25.                 // Resize Map DIV and Refresh
  26.                 onComplete:function(){
  27.                     $("#map").width("99%");
  28.                         $("#map").height("99%");
  29. //                      $("#map").append();
  30. //                      $(".fullscreenmap_cats").draggable( { handle: 'h2' } );
  31.                         map.setCenter(currCenter, currZoom, false, false);
  32.                 },
  33.                 // Return DIV to original state
  34.                 onClosed:function(){
  35.                         $("#map").width(orig_width);
  36.                         $("#map").height(orig_height);
  37.                         $("#map").show();
  38.                         map.setCenter(currCenter, currZoom, false, false);
  39.                 }
  40.         });
  41. });
  42.  
  43. //end fullscreen script
  44. </script>
  45.  
  46.  
  47.  
  48. in the body:
  49. *********************
  50. <div class="fullscreenmap-btn"><a href="#" class="fullscreenmap_click">Full Screen Map</a>
  51. </div>
Advertisement
Add Comment
Please, Sign In to add comment