7079
12-21-2007, 04:17 PM
I have the following script:
<html>
<head>
<title></title>
<style type="text/css">
.body2 {
width:700px;
height:500px;
background-color:green;
}
.details {
width:500px;
height:200px;
left:100px;
top:100px;
background-color:blue;
display:none;
position:absolute;
}
.display {
display:inline;
}
</style>
<script type="text/javascript" src="SpryEffects.js"></script>
<script type="text/javascript">
function fadeOut(){
var effect = new Spry.Effect.Opacity("targetID", 1, 0.2, {duration: 300, toggle: false, finish: displayDetails});
effect.start();
}
function fadeIn(){
var effect = new Spry.Effect.Opacity("targetID", 0.2, 1, {duration: 300, toggle: false});
effect.start();
}
function displayDetails() {
var effect = new Spry.Effect.Grow("targetID2", {duration: 300, toggle: false, from: "0%", to: "100%"});
effect.start();
}
function closeDetails() {
var effect = new Spry.Effect.Grow("targetID2", {duration: 300, toggle: false, from: "100%", to: "0%", finish: fadeIn});
effect.start();
}
</script>
</head>
<body>
<div id="targetID">
<a href="#" onclick="fadeOut();"><h3>Click Me</h3></a>
<div class="body2"></div>
</div>
<div class="details" id="targetID2">
<a href="#" onclick="closeDetails();">close</a><br />
<p>
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
</p>
</div>
</body>
</html>
When I run it the first time, it works great. When I go back to run it again, it gives me an error saying "Invalid argument". Not sure what this means, but I would appreciate any help I can get.
I attached the Spry JS file also, I had to change the file to a .txt so that I can upload it. Don't forget to change the file to .js so that you can run the script.
Thanks,
7079
<html>
<head>
<title></title>
<style type="text/css">
.body2 {
width:700px;
height:500px;
background-color:green;
}
.details {
width:500px;
height:200px;
left:100px;
top:100px;
background-color:blue;
display:none;
position:absolute;
}
.display {
display:inline;
}
</style>
<script type="text/javascript" src="SpryEffects.js"></script>
<script type="text/javascript">
function fadeOut(){
var effect = new Spry.Effect.Opacity("targetID", 1, 0.2, {duration: 300, toggle: false, finish: displayDetails});
effect.start();
}
function fadeIn(){
var effect = new Spry.Effect.Opacity("targetID", 0.2, 1, {duration: 300, toggle: false});
effect.start();
}
function displayDetails() {
var effect = new Spry.Effect.Grow("targetID2", {duration: 300, toggle: false, from: "0%", to: "100%"});
effect.start();
}
function closeDetails() {
var effect = new Spry.Effect.Grow("targetID2", {duration: 300, toggle: false, from: "100%", to: "0%", finish: fadeIn});
effect.start();
}
</script>
</head>
<body>
<div id="targetID">
<a href="#" onclick="fadeOut();"><h3>Click Me</h3></a>
<div class="body2"></div>
</div>
<div class="details" id="targetID2">
<a href="#" onclick="closeDetails();">close</a><br />
<p>
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
</p>
</div>
</body>
</html>
When I run it the first time, it works great. When I go back to run it again, it gives me an error saying "Invalid argument". Not sure what this means, but I would appreciate any help I can get.
I attached the Spry JS file also, I had to change the file to a .txt so that I can upload it. Don't forget to change the file to .js so that you can run the script.
Thanks,
7079