The main problems I am having with my NN4.7 browser are -
1) It won't obey width attribute of css.
2) Weird padding and margin in the layer.
3) Border(style:outset) around the layer is not being displayed, I have
also tried solid, but no luck.
4) Also whenever I use class for a Button, the buttons are displayed on
separate lines in Netscape 4.x, so I have commented that code in CSS.
How can I prevent this?
Here is the code -
=============================================================================
<html>
<head>
<style>
<!--
.dlg {color:#000000; background-color:#D4D0C8;
layer-background-color:#D4D0C8; position:absolute; left:100px;
top:200px; width:300px;
padding-left:1px; padding-right:1px; padding-top:1px;
padding-bottom:1px;
border-width:2px; border-style:outset; visibility:hidden;
z-index:999;}
/* .dlgbutton {margin-left:5px; margin-right:5px; padding-left:5px;
padding-right:5px;} */
.dlgtext {padding-left:10px; padding-right:10px; border:0px;}
.dlgtitle {color:#ffffff; background-color:#000080;
layer-background-color:#000080; font-weight:bold;
margin-top:1px; margin-bottom:10px; margin-left:1px;
margin-right:1px; border:none;}
-->
</style>
<title> Custom Dummy Dialog </title>
<script type="text/javascript" language="JavaScript">
<!--
var brw = navigator.appName;
var ver = parseInt((navigator.appVersion).charAt(0));
var szDlgResult = "";
var szContents ="";
var szArray = new Array();
szArray[0] = "Yes";
szArray[1] = "No";
szArray[2] = "Cancel";
function toggleDialog(szState)
{
if('Netscape' == brw && ver < 5)
{
document.layers["DlgBox"].visibility = ("Visible" == szState) ?
"show" : "hide";
}
else if('Netscape' == brw && ver >= 5)
{
var obj = document.getElementById("DlgBox");
obj.style.visibility = szState;
}
else // IE
{
document.all["DlgBox"].style.visibility = szState;
}
}
function createDialog(szTitle, szMessage, szLabelArray)
{
toggleDialog('Visible');
//create all components of dialog box
szContents = '<div class="dlgtitle"> ' + szTitle
+'<\/div>\n';
szContents += '<div class="dlgtext">' + szMessage + '<\/div>\n'
szContents += '<br><br>\n';
szContents += '<form name="DlgForm">\n<center>\n';
for(i=0; i< szLabelArray.length; i++)
{
szContents += ' <input type="button" class="dlgbutton" value="'
+ szLabelArray[i] + '" onClick="clickDialog(this);"> \n';
}
szContents += '<\/center>\n<\/form>\n';
//alert(szContents); //see if the contents are proper and valid
if ('Netscape' == brw && ver < 5)
{
document.layers['DlgBox'].document.open();
document.layers['DlgBox'].document.write(szContents);
document.layers['DlgBox'].document.DlgForm.elements[0].focus();
document.layers['DlgBox'].document.close();
}
else if('Netscape' == brw && ver >= 5)
{
var obj = document.getElementById("DlgBox");
obj.innerHTML = szContents;
document.DlgForm.elements[0].focus();
}
else if (document.all) //IE
{
document.all["DlgBox"].innerHTML = szContents;
document.DlgForm.elements[0].focus();
}
}
function clickDialog(objButton)
{
toggleDialog('Hidden');
szDlgResult =objButton.value;
handleDialog(); //don't poll me, I'll call you
//return objButton.value;
}
function handleDialog()
{
/* This is the handler of the dialog
put functionality you want on particular button clicked here
*/
if(szArray[0] == szDlgResult)
{
alert(szDlgResult);
self.close();
}
else
{
alert(szDlgResult);
}
}
// -->
</script>
</head>
<body>
<div id="DlgBox" class="dlg">
Initial Text
</div>
Line 1<br>
Line 2<br>
Line 3<br>
Line 4<br>
<form>
<input size="20" type="text" value="12345">
</form>
<a href="JavaScript:createDialog('Are you sure?', 'Do you want to close
the browser window?', szArray); void 0">
Show Dummy Dialog
</a>
</body>
</html>
==========================================================================================
Thanx,
- Manish
--
Martin Honnen
http://javascript.faqts.com/
http://home.t-online.de/home/martin.honnen/jsgoddies.html
- Manish
"Martin Honnen" <Martin...@t-online.de> wrote in message
news:3B6A837D...@t-online.de...
http://www.useractive.com/learning/dhtml/dhtmltut5.php3
They talk about Netscape 4 not getting the box properties right, and offer some
fix...
Sergey
- Manish
"Sergey Snovskiy" <se...@sdci.net> wrote in message
news:3B7030C9...@sdci.net...