我在我的网站上有一个jquery手风琴,并在手风琴第一部分的div上放置了一个nicescroll。
当我移动到手风琴的下一部分并显示新的内容时,前一部分的nicescrollbar仍然可见。
我怎样才能在移动到手风琴的其他部分时删除它?
<script type="text/javascript">
jQuery(document).ready(function () {
$("#wizard").accordion({
heightStyle: "content"
});
$('#wizard').accordion();
$('#wizard button').click(function (e) {
e.preventDefault();
var delta = ($(this).is('.next') ? 1 : -1);
$('#wizard').accordion('option', 'active', (
$('#wizard').accordion('option', 'active') + delta));
});
$("#boxscroll").niceScroll({
touchbehavior: false,
cursorcolor: "#34759a",
cursoropacitymax: 0.7,
cursorwidth: 7,
cursorborder: "1px solid #2848BE",
cursorborderradius: "8px",
background: "#ccc",
autohidemode: false
});
});
</script>
我只是把所有的内容放在一个div里,然后把它的id(scrollContent)加到脚本里。
$("#boxscroll").niceScroll({
"#scrollContent",
touchbehavior: false,
cursorcolor: "#34759a",
cursoropacitymax: 0.7,
cursorwidth: 7,
cursorborder: "1px solid #2848BE",
cursorborderradius: "8px",
background: "#ccc",
autohidemode: false
});