CUSTOM ALERT BOX

L

L-and-F

www.lee-mcgeorge.co.uk

I've been using custom Alert boxes for a long time in various guises.
The way I've shown below is perhaps the easiest.
There are more efficient and cleaner ways to do it, but this is so easy, it
works a treat.
You can also put new <DIV> tags inside the alert to have "Accept" "Decline"
"Cancel" buttons

www.lee-mcgeorge.co.uk

<html>
<head>

<script>
function stylealert(){
placement.innerHTML=message.newalert.value
}
</script>

</head>
<body>


<form name="message">

<!-- PUT YOUR ALERT AS A FIXED SIZED DIV INSIDE THIS CSS-HIDDEN TEXTAREA -->

<textarea name="newalert" style="visibility:hidden">
<div style="width:256px; height:170px; background-color:yellow; border:solid
1px black;"onClick="this.style.visibility='hidden'">
<br>
<center>
<b>
A new kind of alert box
</b>
<br>
<br>
<br>
Click to Close
</center>
</div>
</textarea>


<input type="button" value="Click for alert" onClick="stylealert()">

</form>



<!-- IF YOU WANT TO POSITION THE ALERT DIV USE CSS - position:absolute;
left:Xpx; top:Xpx -->
<!-- OR USE JAVASCRIPT TO DETERMINE THE CENTER OF THE SCREEN-->
<a name="placement"></a>

</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,068
Latest member
MakersCBDIngredients

Latest Threads

Top