Atitit. The implementation of the button cursor over the highlight toggle and other dynamic effects css HTML JS--attilax summary

Source: Internet
Author: User

Atitit. button cursor over highlight toggle and other dynamic effect implementations css HTML js--attilax Summary

4. mouse over the dynamic picture switch implementation 1

4.1. Priority mode :: CSS mode ... 1

4.2. Second Mode 2:: Set the property mode. 1

4.3. final Pattern 3:: Write Mouse Listener 1

4. Mouse over the dynamic picture switch implementation 4.1. Priority mode:: CSS mode ...

C + + QT can use this mode

However, this pattern can only be backgroud,,, without an img SRC attribute:

Author :: Old Wow's paw attilax ayron, email:[email protected]

Reprint please indicate source: Http://blog.csdn.net/attilax

4.2. Second Mode 2:: Set the property mode.

Java does not support CSS mode, you can use attribute mode. However, the set of properties is much more, you can extract an extension class.

And a HTML5 LAN, IMG still does not support this mode.

4.3. Final mode 3:: Write Mouse Listener

HTML JS is implemented using jquery

$ ("#n3a_r2_c2"). Hover (function () {

$ (this). attr ("src", "images_hover/hove_splice_r2_c2.gif");

},

function () {

$ (this). attr ("src", "img_comm/3a_r2_c2.gif");

}   );

Implementation of Java

Test

Public Static FinalColor button_foreground_color = color.white;
-    Private Booleanhover;
the
*     PublicRbutton () {
$SetFont (NewFont ("System", Font.plain,));
Panax Notoginseng setborderpainted (false);
-Setforeground (BUTTON_COLOR2);
thesetfocuspainted (false);
+ setcontentareafilled (false);
AAddmouselistener (NewMouseadapter () {
the@Override
+              Public voidmouseentered (MouseEvent e) {
-Setforeground (button_foreground_color);
$hover =true;
$repaint ();
-            }
-
the @Override
-             Public voidmouseexited (MouseEvent e) {
WuyiSetforeground (BUTTON_COLOR2);
thehover =false;
-repaint ();
Wu            }
-         });
About    }

Reference

Atitit. GUI Picture Non-rule button and dynamic picture switch implementation Mode Summary java. NET C # C + + web HTML js-attilax column - blog channel -CSDN.NET.htm

JButton Big Makeover - a wen online-blogjava.htm

Atitit. The implementation of the button cursor over the highlight toggle and other dynamic effects css HTML JS--attilax summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.