mjesteve commented on issue #1193:
URL: https://github.com/apache/royale-asjs/issues/1193#issuecomment-1101524164

   
[TestRoyale7.zip](https://github.com/apache/royale-asjs/files/8506704/TestRoyale7.zip)
   
   This is a way to get the width of the scroll bar but as it is implemented in 
a client script it is not a valid solution for the SDK.
   
   In the html template I have replaced ${body} with this script:
     <script type="text/javascript">
   
       function getScrollbarWidth() { 
           var outer = document.createElement("div"); 
           outer.style.visibility = "hidden"; 
           outer.style.width = "100px"; 
           outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps  
       
           document.body.appendChild(outer); 
   
           var widthNoScroll = outer.offsetWidth; 
           // force scrollbars 
           outer.style.overflow = "scroll"; 
           
           // add innerdiv 
           var inner = document.createElement("div"); 
           inner.style.width = "100%"; 
           outer.appendChild(inner); 
           
           var widthWithScroll = inner.offsetWidth; 
           // remove divs 
           outer.parentNode.removeChild(outer); 
   
           var w = widthNoScroll - widthWithScroll; 
   
           return w;
       }
   
       var myApp = new App();
       myApp.widthscroll = getScrollbarWidth();
       myApp.start();
   
     </script>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to