Forum: Rails Spinoffs (closed, excessive spam) Effect.Opacity, childrens and ie?

Posted by Franke (Guest)
on 2008-06-23 14:38
(Received via mailing list)
I have a div and I want all childrens to have the same opacity as the
div. When I try my code in Firefox everything works out well but in ie
nothing gets the new opacity. (my onclick event is not fired on the
div in ie... don't know why...)
Is there something I need to do that only applies to ie or something?

Any thoughts about this would be really good! Thanks!



Cheers,
Franke
Posted by Frederick Polgardy (Guest)
on 2008-06-23 14:48
(Received via mailing list)
You mean other than the fact that IE doesn't support the opacity style 
at
all? ;-)

If you're using Effect.Opacity, scriptaculous should take care of the 
issue,
but if you're using style.opacity on DOM elements, it won't work in IE.
Beyond that, hard to say without being able to see your code.

-Fred

On Mon, Jun 23, 2008 at 7:36 AM, Franke <frank.halltorp@gmail.com> 
wrote:

>
> I have a div and I want all childrens to have the same opacity as the
> div. When I try my code in Firefox everything works out well but in ie
> nothing gets the new opacity. (my onclick event is not fired on the
> div in ie... don't know why...)
> Is there something I need to do that only applies to ie or something?


--
Science answers questions; philosophy questions answers.
Posted by Franke (Guest)
on 2008-06-23 15:09
(Received via mailing list)
I'm using Effect.Opacity so I thought there should be no problem.

Here is my code:

    var charts = $$('.chartlink');
    var lastClicked;

    $('<%= lblChangingChart.ClientID %>').hide();

    charts.each( function(chart) {
        chart.onclick = function() {
            var questionid = 0;
            if (typeof(lastClicked) != 'undefined') new
Effect.Opacity(lastClicked, { from: 1.0, to: 0.5, duration: 0.5 });
            lastClicked = this;
            $('<%= lblChangingChart.ClientID %>').show();

            if ($('questionid')) {
                questionid = $F('questionid');
            };

            new Effect.Opacity(this, { from: 0.5, to: 1.0, duration:
0.5 });
            new Ajax.Request('/Handlers/ChartHandler.ashx', {
                method: 'get',
                onSuccess: function(resp) {
                    Effect.Fade($('<%= lblChangingChart.ClientID
%>').id, { duration: 0.5 });
                    $($F('previewid')).src = chart.childElements()
[0].src;
                },
                onFailure: function(resp) {

                },
                parameters: {
                    selectedchartid : this.id,
                    questionid : questionid
                }
            });
        }

        new Effect.Opacity(chart, { from: 1.0, to: 0.5, duration:
0.5 });
    });

Well, there is no errors in firefox so I wonder where my problem is?
This topic is locked and can not be replied to.