#157 √ resolved
Paulo Pereira

CSS Selector finds only the first in Opera.

Reported by Paulo Pereira | June 10th, 2008 @ 12:04 AM | in 1.6.0.3

I have this function:


  // the variables used are these:
  // to_hide = ['global', 'local'];
  // to_show = ['group'];

  to_hide.each(function(el){
    $$('table.cs_table td.cs_'+el).invoke('hide');
  });

  to_show.each(function(el){
    $$('table.cs_table td.cs_'+el).invoke('show');
  });

The problem is that in Opera, this only works for the FIRST td.cs_global, td.cs_local, td.cs_group in the FIRST table.cs_table

But, if I do it like this:


  // the variables used are these:
  // to_hide = ['global', 'local'];
  // to_show = ['group'];

  to_hide.each(function(el){
    $$('#call_status_div td.cs_'+el).invoke('hide');
  });

  to_show.each(function(el){
    $$('#call_status_div td.cs_'+el).invoke('show');
  });

This will work in Opera.

Extract from the DOM tree:


<HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <HEAD></HEAD>
  <BODY>
    <DIV id="logobar"></DIV>
    <DIV id="errorbar"></DIV>
    <UL id="menu" class=""></UL>
    <DIV id="right_sidebar"></DIV>
    <DIV id="container">
      <DIV id="ivr_info_div" style="display: none"></DIV>
      <DIV id="current_info_div" style="display: none"></DIV>
      <DIV id="call_status_div" style="">
        <P class="options"></P>
        <DIV class="trace" id="call_status_options" style="display: none"></DIV>
        <DIV id="cs_table_tbody">
          <DIV class="content_wrapper">
            <H2></H2>
            <TABLE class="cs_table">
              <TBODY>
                <TR>
                  <TD></TD>
                  <TD class="number"></TD>
                  <TD class="cs_bar cs_global"></TD>
                  <TD class="cs_bar cs_group" style="display: none"></TD>
                  <TD class="cs_bar cs_local" style="display: none"></TD>
                  <TD class="number"></TD>
                </TR>
                <TR>
                  <TD></TD>
                  <TD class="number"></TD>
                  <TD class="cs_bar cs_global"></TD>
                  <TD class="cs_bar cs_group" style="display: none"></TD>
                  <TD class="cs_bar cs_local" style="display: none"></TD>
                  <TD class="number"></TD>
                </TR>
                <TR></TR>
                <TR></TR>
              </TBODY>
            </TABLE>
          </DIV>
          <DIV class="content_wrapper">
            <H2></H2>
            <TABLE class="cs_table">
              <TBODY>
                <TR>
                  <TD></TD>
                  <TD class="number"></TD>
                  <TD class="cs_bar cs_global"></TD>
                  <TD class="cs_bar cs_group"></TD>
                  <TD class="cs_bar cs_local"></TD>
                  <TD class="number"></TD>
                </TR>
                <TR></TR>
                <TR></TR>
                <TR></TR>
              </TBODY>
            </TABLE>
          </DIV>
          <DIV class="content_wrapper"></DIV>
          <DIV class="content_wrapper"></DIV>
          <DIV class="content_wrapper"></DIV>
          <DIV class="content_wrapper"></DIV>
        </DIV>
      </DIV>
      <DIV id="channel_info_div" style="display: none"></DIV>
      <DIV id="channel_graph_div" style="display: none"></DIV>
      <DIV id="service_info_div" style="display: none"></DIV>
      <DIV id="service_graph_div" style="display: none"></DIV>
      <DIV id="board_info_div" style="display: none"></DIV>
    </DIV>
    <DIV id="ivrs_table_div"></DIV>
    <DIV style="clear:both"></DIV>
    <DIV style="clear:both; display: none;" id="test"></DIV>
  </BODY>
</HTML>

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

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

The Prototype JavaScript library.

Shared Ticket Bins

Tags