sumoselect多个下拉列表在页面加载时闪烁

时间:2017-11-02 12:03:35

标签: javascript jquery asp.net sumoselect.js

嗨我正在使用带有复选框的sumoselect下拉列表,它在IE浏览器上工作正常并且没有闪烁但是在Chrome浏览器上它在第一次加载页面时闪烁或刷新页面任何一个解决我弄清楚了这个问题。我附上了这些代码。

<script type="text/javascript">
    $(document).ready(function () {

        window.searchSelAll = $('.search-box-open-up').SumoSelect({ csvDispCount: 3, selectAll: true, search: true, searchText: 'Enter here.', up: false });
               });
</script>
<link href="css/sumoselect.css" rel="stylesheet" />

                                                                  

                

2 个答案:

答案 0 :(得分:1)

如果不行则使用此

<style type="text/css">
    .hideAll  {
        visibility:hidden;
     }
</style>

<script type="text/javascript">
    $(window).load(function () {
        $("#mytab").removeClass("hideAll");
    });
</script>

<div id="mytab" class="hideAll">
 --Your Content here----
</div>

答案 1 :(得分:0)

   simply i have been put  set  display: none and call the j query show at the end of HTML DOM it will work for me.Here i am attach example.
    <head>
     <script type="text/javascript" src="js/jquery.sumoselect.js"></script>
    </head>

    <div id="div1" runat="server" class="col" style="display: none;">

      <table class="table table-bordered" style="margin-bottom: 0; background-color: #FFF; border: 2px solid black;">

                <tr>
                    <td id="tdcompany1" runat="server">Select Company : </td>

                    <td id="tdcompany" runat="server" colspan="4">
                        <p data-tooltip data-tooltip-message="Please select company name to filter">
                            <asp:DropDownList ID="ddlCompany" runat="server" AutoPostBack="True" Width="370px" onchange="StartProgressBar();" OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged" CssClass="input-block-level">
                            </asp:DropDownList>
                        </p>
                    </td>            </tr>
    </table>
    <script type="text/javascript">
            $(document).ready(function () {
                $('.col').show(); // changed this line

            });
        </script>