
Originally Posted by
Blabj
I went and had a look around and found the script's homepage (
http://www.curvycorners.net/index.php ) and downloaded the package, which included a demo.html, so I opened it and straight away it shows you how they create the javascript objects and how to edit them, try putting this in the head of your document.
Code:
<script type="text/JavaScript">
window.onload = function()
{
settings = {
tl: { radius: 10 },
tr: { radius: 10 },
bl: { radius: 10 },
br: { radius: 10 },
antiAlias: true,
autoPad: true,
validTags: ["div"]
}
var myBoxObject = new curvyCorners(settings, "myBox");
myBoxObject.applyCornersToAll();
}
</script>
And then give your box the div class of myBox.
I used this code when giving what you told me to do.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/JavaScript">
window.onload = function()
{
settings = {
tl: { radius: 10 },
tr: { radius: 10 },
bl: { radius: 10 },
br: { radius: 10 },
antiAlias: true,
autoPad: true,
validTags: ["div"]
}
var myBoxObject = new curvyCorners(settings, "myBox");
myBoxObject.applyCornersToAll();
}
</script>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:229px;
top:21px;
width:630px;
height:117px;
z-index:1;
background-color: #0066FF;
}
.style1 {
font-size: 36px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<div align="center" class="style1">Test Boxes</div>
</div>
</body>
</html>
and the box turned out looking like the test1.jpg attachment.
Then I changed the div id like you told me to do and the code looked like this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/JavaScript">
window.onload = function()
{
settings = {
tl: { radius: 10 },
tr: { radius: 10 },
bl: { radius: 10 },
br: { radius: 10 },
antiAlias: true,
autoPad: true,
validTags: ["div"]
}
var myBoxObject = new curvyCorners(settings, "myBox");
myBoxObject.applyCornersToAll();
}
</script>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:229px;
top:21px;
width:630px;
height:117px;
z-index:1;
background-color: #0066FF;
}
.style1 {
font-size: 36px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div id="myBox">
<div align="center" class="style1">Test Boxes</div>
</div>
</body>
</html>
Bold is the only change I made to the script. After that I viewed it in firefox again and it showed up looking like test2.jpg attachment.