PDA

View Full Version : Scriptaculous Effect Trouble??



JChristian
May 28th, 2008, 07:07 PM
Hey. I have the following code working with my scriptaculous / prototype js files.


<a href="javascript:Effect.toggle('sec1','slide',{duration: 2.0, scaleX:true, scaleY:false});">ONE</a>
<a href="javascript:Effect.toggle('sec2','slide',{duration: 2.0, scaleX:true, scaleY:false});">TWO</a>
<a href="javascript:Effect.toggle('sec3','slide',{duration: 2.0, scaleX:true, scaleY:false});">THREE</a>
<div style="overflow:hidden;height:100px;width:100px;position: fixed;">
<div id="sec1" style="height:100px;width:100px;background-color:#D5D5D5;float:left;position:relative;"> BLAH BLAH BLAH 1</div>
<div id="sec2" style="height:100px;width:100px; background-color:#ABABAB; float:left;position:relative;"> BLAH BLAH BLAH 2</div>
<div id="sec3" style="height:100px;width:100px; background-color:#030303;float:left;position:relative;"> BLAH BLAH BLAH 3</div>
</div>

But it keeps throwing an error "element.down() has no properties" effects.js line 728 anybody have any ideas as to how to fix it so that toggle / slide work left to right instead of up & down ??

fasterthanlight™
May 28th, 2008, 07:14 PM
post some linkz yo!

JChristian
May 29th, 2008, 11:03 AM
http://jkirchartz.googlepages.com/scriptaculous_slidestrip.html here's the page.

I'm testing using firefox & firebug.

in IE7 it gives me the 'debug' alert.

fasterthanlight™
May 29th, 2008, 11:05 AM
looks like your script source path is wrong,

js/prototype.js
js/scriptaculous.js

it shouldn't have the js/

unless you make a directory and put all your js there

JChristian
May 29th, 2008, 11:15 AM
I just realized that and fixed that issue, now it's throwing the error I was seeing before.

fasterthanlight™
May 29th, 2008, 11:23 AM
Ok it seems that it just doesn't accept "down" ... are you sure this effect supports it?

check the documentation or do some googling to find out... if that function only supports left and right then you're going to have to find another chunk of code to get it done

JChristian
May 29th, 2008, 05:10 PM
The effect is straight from scriptaculous, which relies on prototype, and works on all the website demo's ... check that link again. I think I got it working (and I'm not sure why it works now, I didn't change much.)

fasterthanlight™
May 29th, 2008, 05:16 PM
Well from what I can tell you're using a whole new function, which is not a "didn't change much"

I get no errors, so I think you're in the clear

somnamblst
May 30th, 2008, 10:45 AM
Do you have all the scriptaculous effects files uploaded or available locally? Have you changed any of the paths from the scriptaculous demos?

I had a similar issue once I uploaded my files to the server because I didn't realize that scripts such as behavior.js and effects.js were being used in addition to for instance slider.js

I also found that I needed to keep the directory structure I found in the scriptaculous demos. Some of my files were pathed to lib some to src.