如何将鼠标放在图像上的原始按钮,鼠标离开按钮? [英] How to put images for primefaces buttons when mouse over and mouse away from button?

查看:179
本文介绍了如何将鼠标放在图像上的原始按钮,鼠标离开按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是表面3.5

I'm using primefaces 3.5

当鼠标悬停在图像上时,有一个问题,鼠标离开按钮。

I have a problem while setting images to button when mouse over and mouse away from button. please tell me how to do it for primefaces.

提前感谢

推荐答案

我有它

XHtml代码:

    <p:commandButton icon="myIcon" styleClass="myButton"  
                     actionListener="#{routeController.createNewRoute}"
                     update=":routeHeaderForm"/>

CSS代码:

.myButton .myIcon {
                background: url('../images/add_off_18.png');
                width: 39px; height: 19px;
                left: 1%;
                margin-left:0px;
            }

          .myIcon:hover {
                width: 39px; height: 19px;
                background: url('../images/add_on_18.png');
            }

          .myButton {
                width: 39px; height: 19px;
            }

这篇关于如何将鼠标放在图像上的原始按钮,鼠标离开按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆