...

View Full Version : Help With Script



7079
12-21-2007, 05: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

7079
12-21-2007, 05:20 PM
Not sure what happened to the attachment, I'm trying to do it again.

7079
12-21-2007, 05:24 PM
http://labs.adobe.com/technologies/spry/home.html is the link for the spry home page. If you want to run the script you should download at least the SpryEffects.js file so that you can see what the issue is.

Philip M
12-21-2007, 06:37 PM
http://www.codingforums.com/showthread.php?t=2090

Especially paragarphs 1 and 3.

7079
12-21-2007, 10:31 PM
I reposted my request for help under a more specific title, here it is:

http://codingforums.com/showthread.php?t=130101



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum