5

I am using jquery slimscroll. But it is not appearing on the page. Any help would be appreciated.

HTML -

<script type="text/javascript" src="resources/js/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="resources/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="resources/js/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="resources/js/searchHistory.js"></script>

<div id="searchTable" class="contentRight">
    <table id="searchInfo" class="shadeTable"></table>
</div>

JS -

$(document).ready(function() {

    $('#searchTable').slimScroll({
        color: '#FF915E',   
        height: '250px',
            alwaysVisible: true,
              size: '8px'
    });
    initSearchInfo();
    initTagCloud(); 
});

I am updating the content of target div dynamically in initSearchInfo function using ajax call. So I have applied slimscroll again in the initSearchInfo function at the end -

if($('#searchTable').parent('.slimScrollDiv').size() > 0) {
                $('#searchTable').parent().replaceWith($('#searchTable'));
                // now (re)assign slimScroll
                $('#searchTable').slimScroll({
                  color: '#FF915E', 
                  height: '353px',
                  alwaysVisible: true,
                  size: '8px'
            });

CSS -

.contentRight {float: right}
snowp
  • 495
  • 1
  • 6
  • 22
Popeye
  • 1,548
  • 3
  • 25
  • 39

0 Answers0