« February 2012 | Main | April 2012 »
March 16, 2012
Fixing the scrollbar issue in GoogleMaps InfoWindow
<script type="text/javascript"> var contentString = '<div style="max-width: 200px; overflow: hidden; display: none;" id="noscroll"><h4>The Business School</h4>29 Buccleuch Place, EH8 9JS</div>'; jQuery(document).ready(function(){ var latlong = new google.maps.LatLng(55.942802, -3.186896); var opts = { zoom: 15, center: new google.maps.LatLng(55.945000, -3.186896), mapTypeControl: false, disableDefaultUI: false, mapTypeId: google.maps.MapTypeId.ROADMAP, scaleControl: true }; var map = new google.maps.Map(document.getElementById("map"), opts); var infowindow = new google.maps.InfoWindow({ content: contentString, maxWidth: 100 }); var marker = new google.maps.Marker({ position: new google.maps.LatLng(55.942802, -3.186896), map: map, title: "Business School" }); infowindow.open(map, marker); }); </script>
The function call infowindow.open(map, marker) sets up your bubble content in two nested DIVs with overflow: auto styling set. This needs to be undone once the bubble is created. Hence the 2 second wait.
<script type="text/javascript"> var ns; var flag = 0; function fix_it(lag){ setTimeout(function(){ try{ ns = document.getElementById('noscroll'); var pops = ns.parentNode; var gramps = pops.parentNode; gramps.style.overflow = 'hidden'; pops.style.overflow = 'hidden'; ns.style.overflow = 'hidden'; ns.style.display = 'block'; } catch(e){ if(flag == 0){ flag = 1; fix_it(2000); } } }, lag); } jQuery(document).ready(function(){ fix_it(2000); }); </script>
Posted by pj at 10:42 PM | Comments (0)
March 14, 2012
HTML Tag Support Detection
HTML5 Day 3: Detecting HTML5 Support via JavaScript
Posted by pj at 07:36 PM | Comments (0)
March 13, 2012
HTML5 and CSS3
HTML 5 and CSS 3: The Techniques You’ll Soon Be Using | Nettuts
Posted by pj at 09:53 AM | Comments (0)
March 09, 2012
Tree Surgeons
Posted by pj at 09:48 AM | Comments (0)
March 05, 2012
OS X on VirtualBox
How to Run Mac OS X in VirtualBox on WindowsPosted by pj at 07:43 PM | Comments (0)