I really tried to solve this one. But nothing seems to work.
I'm trying to create a menu on Top of the page which shall only be visible if hovered.
very Simple Element for now:
topViewSurf = new Surface({
classes: ['topSplash'],
properties: {
backgroundColor: 'rgb(170,210,140)',
boxShadow: '0px 0px 10px rgb(110,150, 90)'
}
});
topViewMod = new Modifier({
origin: [0.5, 0],
size: [this.options.width, 40],
transform: Transform.translate(0,-35,0)
});
this._add(topViewMod).add(topViewSurf);
then I wanted to call this function, should the Element 'topViewSurf' be hovered:
function dropTop(){
topViewMod.setTransform(Transform.translate(0,0,1), 500);
}
For some reason though I can't get hover to work.
I can call the function by:
topViewSurf.on("click", function(){
dropTop()
});
Works perfectly fine. But when I replace 'click' with 'hover' nothing happens when I click or hover the element.
I've tried different approaches for this including jQuery and pure js but nothing seems to work (it might be possible that I did mistakes there) but since I'm asking anyway I thought I would ask for a famo.us solution.
Hope you can help me. spitterfly