Jump to content

Search the Community

Showing results for tags 'onmousewheel'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi, I have this code to evaluate onmousewheel in the screen! How can i use it in Babylon? In fact I want to use the "rolled" var value in a babylon script! <head> <script type="text/javascript"> function MouseScroll (event) { var rolled = 0; if ('wheelDelta' in event) { rolled = event.wheelDelta; } else { // Firefox // The measurement units of the detail and wheelDelta properties are different. rolled = -40 * event.detail; } var info = document.getElementById ("info"); info.innerHTML = rolled; } function Init () { // for mouse scrolling in Firefox var elem = document.getElementById ("myDiv"); if (elem.addEventListener) { // all browsers except IE before version 9 // Internet Explorer, Opera, Google Chrome and Safari elem.addEventListener ("mousewheel", MouseScroll, false); // Firefox elem.addEventListener ("DOMMouseScroll", MouseScroll, false); } else { if (elem.attachEvent) { // IE before version 9 elem.attachEvent ("onmousewheel", MouseScroll); } } } </script> </head> <body onload="Init ();"> Use the mouse wheel on the field below. <div id="myDiv" style="width:200px; height:200px; overflow:auto;"> <div style="height:2000px; background-color:#a08080;"></div> </div> <br /> The last roll amount: <span id="info" style="background-color:#e0e0d0;"></span> </body>
×
×
  • Create New...