简体   繁体   中英

html sidebar won't collapse between 767px and 785px,how do i fix it?

I'm using ADMINLTE to build a website and have a page that it sidebar won't collapse between 767 pixel and 785 pixel other pages have no problem, so i inspect my page and compare the working page shows the below classes

class='skin-blue sidebar-mini sidebar-collapse' and class='skin-blue sidebar-mini'

and the problem page is 'skin-blue sidebar-mini sidebar-open' and 'skin-blue sidebar-mini'

and i check this is the part causes the issues when the iterate more than 4

 for ($x = 0; $x <= 4; $x++){

        ?>
        <div class="col-lg-2 col-md-3 col-xs-6">  
        <form method="post">  
        <div style="border:1px solid #3c8dbc; background-color:#f1f1f1; border-radius:5px; padding:4px 4px; margin-top:10px; margin-right:-11px; margin-left:-11px;" align="center" onClick="document.forms[''].submit();" >  
        <img class="menu_m_img" src="dist/img/<?php echo $row["name"]; ?>" /><br />  
        <h4 class="text-info" style="font-size:12px;"><?php echo mb_strimwidth($row["name"], 0, 18, "...");?></h4>
        <h4 class="text-danger">RM<?php echo $row["name_id"]; ?></h4>                   

        <input type="submit" name="add_to_cart" style="border:none; color:#fff; border-radius:5px;
        background-repeat:no-repeat; width:100%" value="Add to Cart" class="btn btn-primary" />                                 
        </div>  
        </form>  
        </div>  
        <?php  
        }
        }else{?>
        <table class="table table-condensed" id="table" style ="margin-top:10px;">
        <td colspan="4" align="center">No results found</td>
        </table>                        
        <?php 
        }                                   
        ?>

why is this happens and how do i solve this? and may i know how it change the class when i press the button, how it add collapse or -open at class?

If you have sidebar-open as body class, it means you pressed the button and want the sidebar to be open. I don't know how you got it there. You con programatically remove it with $('body').removeClass('sidebar-open');.

tried at other machine, problem not recreated, it only occur in my devices, so for those have this problem try at others devices first...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM