Can't get demo to work

First off, this is a neat script. I'm trying to get the dragable float demo working on a pre-existing website. I updated the paths on the demo to reflect their location on my server. So that isn't the issue. When I run the demo I get an error.

Browser: FireFox 3.0.7
Prototype: 1.6.0.3
Scriptaculous: 1.8.2

Error Line: Line 18 of supplied demo.
Error Message: this.options[element.visible() ? "onclose" : "onopen"] is not a function

The problem lies in this section of code:

//Extend the scal library to add draggable calendar support.
//This script block can be added to the scal.js file.
Object.extend(scal.prototype,
{
toggleCalendar: function()
{
var element = $(this.options.wrapper) || this.element;
/* I added these lines to output debug info to firebug
console.log(element);
console.log(element.visible());
console.log(this.options);
*/
this.options[element.visible() ? 'onclose' : 'onopen'](element);
this.options[element.visible() ? 'closeeffect' : 'openeffect'](element, {duration: 0.5});
},

isOpen: function()
{
return ( $(this.options.wrapper) || this.element).visible();
}
});

probably it's an ugly

probably it's an ugly solution but this will work (effects are gone)
toggleCalendar: function()
{
var element = this.element.identify() + "-container";
if($(element).visible())
{
$(element).hide();
} else
{
$(element).show();
}

/* this.options[element.visible() ? 'onclose' : 'onopen'](element);
this.options[element.visible() ? 'closeeffect' : 'openeffect'](element, {duration: 0.5});
*/ }

Same in here, seems to be

Same in here, seems to be caused by the new version of Prototype and Scriptaculous...

My email

Sorry, I didn't include my name or email on the previous message. The forum admin should now have my email address.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options