[Kss-devel] problem with effects in Opera and IE

Denis Mishunov denis.mishunoff at gmail.com
Wed Aug 15 17:03:01 CEST 2007


Hello, guys.

I am working on my custom kss action currently and have problem with  
the effects. I did my best to locate the problem and here are my  
investigations. I think I might note I do it on Plone, so, that you  
can think this can be related to some registering things in it. Anyway:

Current environment
================
1. prototype.js and effects.js enabled
2. KSS in production mode, so ++resource++kukit.js is available for  
me on Plone that contains my action's JS along with KSS core.
3. Tested browsers - FF, Safari, Opera (Mac), IE7 (Windows)

Task
====
Create a KSS action that would show "backdrop" for the whole site's  
screen clicking on the image's thumbnail as it is done on many-many  
sites when you get the preview of an image or something like that.  
But here it is simple - only backdrop for now no preview, no nothing.

Current implementation
==================
Liisting of my action - http://paste.plone.org/16265. Big kudos goes  
to Lokesh Dhakar (http://huddletogether.com/projects/lightbox2/) for  
his Lightbox 2 script that I use as a basis for my action. In common  
what it does is - create the DIV as the last child of BODY, set it's  
width and height to fully cover the BODY object. Afterwards we have  
two effects - for appearance of that DIV being semi-transparent and  
another one to fade that DIV out again so that it is not visible.

Problem
=======
And here goes interesting part. As you can see, my action uses  
nothing fancy. Only two effects:
Effect.Fade and Effect.Appear. Both should work in any browser. You  
can make sure in this, going to effects demo at script.aculo.us, or  
trying Lokesh's original Lightbox. But for clear experiment let's  
rely on demos on script.aculo.us since Lightbox uses much more effect  
than we need for testing. So far, so good - both my effects should  
work in all browsers. And they really do work well in all tested  
browsers, being the standalone JS (sure with some additions to apply  
'click' events to the links on page's load).

But, then I wrap it with KSS and here the problem appears. I load the  
page and click the link to which the action is assigned. Action works  
in FF and Safari only. Both Opera and IE create the DIV #overlay, but  
nothing more. They just raise JS error. If I wrap both effects with  
comments, so that they are not available for engine, no errors in any  
browser.

Here is the error that Opera shows in it's log:
http://paste.plone.org/16259

IE suggests to run debugger, I run it and it shows the stopper in...

While I was testing this behavior, i has been changed somehow. Now I  
don't get any errors in console. The effect is just not applied in  
Opera and IE. IE shows that small triangle in the bottom left corner  
saying that page was displayed with the errors only. This triangle  
appears only after action is called. When the page loads and action  
is not invoked, there is no triangle.

Possible solutions that were used
==========================
I have tried to change behaviors:
	- got rid of "extending" parameters in effect
	- tried to put other effects instead of existing ones
Both solutions did not work out - behavior remained the same.

And now, the Plone's part. When I run all this with debug mode  
disabled in portal_javascript I have got the described behavior -  
nothing happens in Opera and IE. When I switch p[ortal_javascript to  
debug mode, Opera magically does what it should. Though IE still  
shows that "error triangle". During the testing with debug switched  
off any change of my action was followed by portal_javascript's  
reloading, so it can't be a cache issue or something.

I'm really confused with this behavior. Please let me know whether I  
can test it somehow else and provide more detailed report.

Please tell me where should I look for a solution to this. For me it  
is obvious that the problem relates to KSS and not the effects  
themselves, because pure effects in pure JS work quite nice.

Hope you will advise me something or fix this in KSS please :)

Thank you.



--
Best regards,
Denis Mishunov
PLONE Design-Skinning-Development

mailto:denis.mishunoff at gmail.com
IRC: spliter(#plone)




More information about the Kss-devel mailing list