0
UiApp에서는 마우스가 버튼 위에있을 때 setStyleAttribute를 변경하는 간단한 방법이 있습니다. 기본적으로 롤오버 단추를 만들고 싶습니다.UiApp 버튼 롤오버 setStyleAttribute
UiApp에서는 마우스가 버튼 위에있을 때 setStyleAttribute를 변경하는 간단한 방법이 있습니다. 기본적으로 롤오버 단추를 만들고 싶습니다.UiApp 버튼 롤오버 setStyleAttribute
예, 가능하며 다소 간단합니다.
두 개의 클라이언트 핸들러 (하나는 호버에 스타일을 설정하고 다른 하나는 다시 설정)를 작성해야합니다. 그런 다음 버튼에 다음과 같이 추가하십시오.
var btn = app.createButton('Button').setStyleAttributes({color:'blue'});
var setStyleHover = app.createClientHandler().forEventSource().setStyleAttributes({color:'red'});
var setStyleBack = app.createClientHandler().forEventSource().setStyleAttributes({color:'blue'});
btn.addMouseOverHandler(setStyleHover);
btn.addMouseOutHandler(setStyleBack);
//add button to your interface
//show app
잘 작동합니다. 나는 그것을 변화시키기 위해서 함수를 통과시켜야한다고 생각했다. 고맙습니다. –