Comments (2)
Hmm... I just tried your code and it seems to work fine. I see the click, mouseover, and mouseout console messages. Is there another part of your code that's stopping the propagation of the events?
Here's how I changed my demo code (docs/code.js) in pixi-scrollbox (added test() and changed onload function):
...
function test()
{
let scrollbox = new Scrollbox({
boxWidth: 550,
boxHeight: 348
});
_renderer.stage.addChild(scrollbox);
// insert element
let tableStringContainer = new PIXI.Container(),
hitArea = new PIXI.Graphics();
// just added some colors and circles so I can see the scrollbox and target
hitArea.beginFill(0xff0000).drawCircle(0, 0, 100).endFill()
hitArea.beginFill(0xff0000, 1);
hitArea.drawRect(0, 0, 540, 35);
hitArea.endFill()
hitArea.interactive = true;
hitArea.buttonMode = true;
hitArea
.on('click', function ()
{
console.log('click');
})
.on('mouseover', function ()
{
console.log('mouseover');
})
.on('mouseout', function ()
{
console.log('mouseout');
});
tableStringContainer.addChild(hitArea);
scrollbox.content.addChild(tableStringContainer);
scrollbox.update();
}
window.onload = function ()
{
_fps = new FPS({ side: 'bottom-left' })
_renderer = new PIXI.Application({ transparent: true, width: window.innerWidth, height: window.innerHeight, resolution: window.devicePixelRatio })
document.body.appendChild(_renderer.view)
_renderer.view.style.position = 'fixed'
_renderer.view.style.width = '100vw'
_renderer.view.style.height = '100vh'
_renderer.view.style.left = 0
_renderer.view.style.top = 0
test()
return
horizontalVertical()
vertical()
horizontal()
const nodrag = horizontalVertical('dragScroll=false (drag scrollbars to move)')
nodrag.position.set(400, 425)
nodrag.dragScroll = false
window.addEventListener('resize', resize)
PIXI.ticker.shared.add(() =>
{
_fps.frame()
})
require('./highlight')()
}
from pixi-scrollbox.
It works fine for me after updating dependencies and PIXI.js from 4.2.3 to the latest version.
from pixi-scrollbox.
Related Issues (20)
- Mouse pointer moves faster than the scroll element HOT 4
- Is "auto scroll" possible ? HOT 1
- Scrollbar slow with mouse wheel on Firefox HOT 2
- Scroll wheel is not correctly positioned when app is resized
- Sprites with negative positions not visible in the viewport HOT 2
- direct loading of library in README doesn't work for me
- Cards in Scrollbox not getting click events HOT 6
- Is this project alive? HOT 1
- high cpu usage + glitching of scrolling HOT 1
- Does this lib support zoom action? HOT 2
- when page destroy,the scrollbox's updateLoop will go on HOT 2
- Issue with the pixi inspector: Uncaught DOMException: Failed to execute 'postMessage' on 'Window': scrollbarMove(e)
- Scrolling sideways using a mousewheel HOT 3
- When scrolling with the mouse content jumps on x
- giving bunch of errors
- How do i use in version pixijs6.4.2?
- Click & Hover effects don't work if scrollbar is at the end
- _maskContent interferes with pointer events
- problem with viewport.events HOT 1
- After the parent element is rotated 90 degrees, when the content is dragged, the horizontal and vertical are reversed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixi-scrollbox.