Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
173 views
in Technique[技术] by (71.8m points)

javascript - How to customize the position of an alert box

I am using an alert box to alert some messages after some validation. Now I want to make alert box position over the control where it had a validation error.

As a default, an alert box pops up in center of page, Now I want it at some custom position, for example I have 4 textbox to be validated, textbox-3 has some incorrect data, I want the alert to be presented just above the textbox-3 instead of center of page.

Is this possible to change the display behavior of alert box? If there's no other option to go for jquery dialog box.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since that is a default dialog box, you cannot position that. However, you can design your own custom alert box and position that. Or, you can use 3rd party dialog boxes, jquery ui has a nice one: http://jqueryui.com/dialog/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...