Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript javascript and media queries Reply To: javascript and media queries

#237934
chauhanheena
Participant

@shikkwdiel

the following is the entire code:

        <script type="text/javascript">
            window.addEventListener("load", function() {
                var options = {
                   width:621,
                   height:545,
                   rotationIdleSpeedFactor: 10.0,
                   rotationSpeedFactor: 1.5,
                   wave: false
                };
                var globe = new Globe(document.getElementById("3DView"),options);
                var img = new Image();
                var items = [];
                img.onload = function() {
                     globe.addImage(13.006415, 77.659382, img);
                };
                img.src = "globe/item.png";
                window.setInterval(function() {
                      globe.addImage(13.006415, 77.659382, img, { color: [ 1.0, 0.0, 0.0, 0.9] }, function() { osg.log("Hit itemID " + this.itemID ); } );
                   }, 500);
            },true);
        </script>

How do i bring in matchMedia() to set the width and height to the max width of the screen (responsiveness)