Script.aculo.us effects not working with zenJavascript(); call??

Howdy all,
I'm pulling out my hair trying to get the script.aculo.us toys to work with my ZenPhoto installation. I've been working at this problem for over 5 hours now, with no resolution. When I try to do an effect to reveal the commenting section, the link doesn't work! The only way I can get this to work as advertised is by deleting the following line from my head section:
<?php zenJavascript(); ?>
If I delete that line, the following code works perfectly. However, when I delete it, bad stuff happens elsewhere! As long as that code remains in my head section, my effects code is dead-in-the-water. Any suggestions??

Here's my script:

Effect.OpenUp = function(element) {
element = $(element);
new Effect.BlindDown(element, arguments[1] || {});
}

Effect.CloseDown = function(element) {
element = $(element);
new Effect.BlindUp(element, arguments[1] || {});
}

Effect.Combo = function(element) {
element = $(element);
if(element.style.display == ‘none’) {
new Effect.OpenUp(element, arguments[1] || {});
}else {
new Effect.CloseDown(element, arguments[1] || {});
}
}

I'm calling it with the following link:

add comment

Which should make this visible:

<div id="commentForm" style="display:none">
...
...
</div>

Comments

  • acrylian Administrator, Developer
    You did not say which Zenphoto version... Anyway, Zenphoto uses jQuery and the next version (and the current nightly/svn already now) dropped everything that was script.aculo.us related now (like the backend album sorting). There might be a conflict with jQuery.
  • I am running zenphoto version 1.2.2 [2983].

    Is there any way to convert this to something that would work with script.aculo.us? Script.aculo.us seems to be included with ZenPhoto in the zp-core/js directory. Am I missing something here? Do you know how to make this work somehow? Basically, I'm just trying to get the comments section to hide/unhide. You can check out what I currently have at:

    http://www.aggiesterlings.com
  • Scriptaculous is still part of the 1.2.2 release, so that is not your problem. However, since what you are trying does not work and scriptaculous will be dropped from the next release (coming soon) you should probably find a jQuery plugin to do what you want.
  • acrylian Administrator, Developer
    jQuery already features standard toggle/hide functions, no plugin necessary. Please refer to the jQuery site.
Sign In or Register to comment.