-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volume Bar disappears when mouse goes on it #78
Comments
Yes, can this problem be repaired? Thank you |
this problem still exists in version 6.0.1, can it be fixed ? |
I fixed the problem using following code var wjs = require("wcjs-player");
var player = new wjs("#player").addPlayer({
autoplay: true,
wcjs: require('wcjs-prebuilt')
});
// find volume button and control
var volButton = player.find('.wcp-vol-button');
var volControl = player.find('.wcp-vol-control');
// remove wrong listeners
volButton.off('mouseleave');
volControl.off('mouseout');
// watch cursor position
var isOverButton = false;
volButton.on('mouseenter', function () { isOverButton = true; });
volButton.on('mouseleave', function () { isOverButton = false; });
var isOverControll = false;
volControl.on('mouseenter', function () { isOverControll = true; });
volControl.on('mouseleave', function () { isOverControll = false; });
var hideVolControlIfNeeded = function () {
setTimeout(function () {
if ( !(isOverButton || isOverControll) ) {
volControl.animate({ width: 0 }, 200);
}
}, 300);
};
// hide volume control on mouseleave if mouse not over volume button or volume control
volButton.on('mouseleave', hideVolControlIfNeeded);
volControl.on('mouseleave', hideVolControlIfNeeded); |
@ondrejpaluch please Fork the project and send a PR, I would gladly accept it and credit you accordingly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the mouse goes on the volume icon, the bar appears, but I can't use the bar because when the mouse moves from the volume icon to the volume bar, the volume-bar disappears immediately.
The text was updated successfully, but these errors were encountered: