jquery mobile как выделить ui-state-highlight

#jquery-mobile #highlight

#jquery-mobile #выделить

Вопрос:

Есть ли в jQuery Mobile что-нибудь для выделения? Например, выделите строку таблицы. В Jquery ui есть ui-state-highlight.

 <table>
   <tr class="ui-state-highlight">
  

Это должно работать с разными темами и образцами.

Спасибо.

Ответ №1:

 /*
I'm also searching for that question. The only way I just now can think at this is using jQuery to find the selector:
 $("table tr.myTR").addClass('error');*/


----------


    <style>
    .error {
    background-color: #fbec88;
    }
    tr:nth-child(even) {
    background: #e9e9e9;
    }
    </style>


 <div data-role="content">

        <table data-role="table" data-mode=""  id="myTable">

            <tbody>
            <tr class="myTR">
                <td>Alfreds Futterkiste</td>
            </tr>
            <tr>
                <td>Maria Anders</td>
            </tr>
            <tr>
                <td>Obere Str. 57</td>
            </tr>
            <tr>
                <td>Berlin</td>
            </tr>
            <tr>
                <td>12209</td>
            </tr>
            <tr>
                <td>Germany</td>
            </tr>
            </tbody>
        </table>
    </div>

</div>

<script>
    $(function () {
        $("table tr.myTR").addClass('error');
    })

</script>
  

Комментарии:

1. Добавьте некоторое объяснение с ответом о том, как этот ответ помогает OP в устранении текущей проблемы