This project is archived and is in readonly mode.

#754 ✓duplicate
MontagsMeeting

setting opacity makes elements visible

Reported by MontagsMeeting | September 24th, 2009 @ 05:24 PM | in 2.0 (closed)

When i set the opacity of an element that is contained in an invisible element it becomes visible but the container stays invisible
For this HTML:


This Javascript makes the new Element visible:
$('Container').grab( new Element( 'div', {

'styles':{
    'backgroundColor':'#ffffff',
    'opacity':0.5
}

}

While with this Javascript the new Element stays invisible:
$('Container').grab( new Element( 'div', {

'styles':{
    'backgroundColor':'#ffffff',
}

}

this should not happen by setting opacity. I tested it in a lot of browsers and can't find a reason for this behavior, so i decided to create a new Ticket.
I discussed this on http://www.mooforum.net/help12/opacity-and-visibility-t2237.html

Comments and changes to this ticket

  • MontagsMeeting

    MontagsMeeting September 25th, 2009 @ 09:15 AM

    Sorry for the missing and bad formatting, i'll try again:

    For this HTML:
    <div id="Container" style="visibility:hidden;"> </div>

    This Javascript makes the new Element visible:

        $('Container').grab( new Element( 'div', {

        'styles':{
            'backgroundColor':'#ffffff',
            'opacity':0.5
        }
    }</code>
    
    
    
    

    While with this Javascript the new Element stays invisible:

        $('Container').grab( new Element( 'div', {

        'styles':{
            'backgroundColor':'#ffffff'
        }
    }</code>
    
    
    
    

    this should not happen by setting opacity. I tested it in a lot of browsers and can't find a reason for this behavior, so i decided to create a new Ticket.
    I discussed this on http://www.mooforum.net/help12/opacity-and-visibility-t2237.html

  • Fábio M. Costa

    Fábio M. Costa October 3rd, 2009 @ 04:30 PM

    Hi it seens like mootools 1.2 set visibility: visible when you set opacity to a value different of 0.
    But if you use setOpacity function this behavior doesnt happen.
    What you could do is:

    $('Container').grab( new Element( 'div', {
      'styles':{
        'backgroundColor':'#ffffff'
      }
    }).setOpacity(0.5));
    

    This works fine.

    mooshell of this problem:
    http://mooshell.net/wwz3w/

    and mooshell version of the fix:
    http://mooshell.net/TUGCp/1

  • fakedarren

    fakedarren February 8th, 2010 @ 02:03 PM

    • State changed from “new” to “open”
    • Assigned user set to “fakedarren”
    • Milestone changed from 2.0 to 1.3.0 rc2
  • fakedarren

    fakedarren February 15th, 2010 @ 09:00 PM

    • Assigned user changed from “fakedarren” to “Christoph Pojer”

    Christoph, assigning to you so you're aware of the issue; please reassign to whoever will get this in to 1.3 or 2.0.

  • Christoph Pojer

    Christoph Pojer February 24th, 2010 @ 02:09 AM

    • Milestone changed from 1.3.0 rc2 to 2.0

    This is, as fabio pointed out, by design. We may change this in 2.0. Please use setOpacity for now.

  • Christoph Pojer

    Christoph Pojer August 30th, 2010 @ 08:46 PM

    • Assigned user cleared.
    • Milestone order changed from “0” to “0”
  • Christoph Pojer

    Christoph Pojer April 16th, 2011 @ 10:00 AM

    • Tag changed from core, css, opacity, visibility to css, core, opacity, visibility
    • State changed from “open” to “duplicate”

    duplicate of #680

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages