doutuan4361 2012-10-11 04:10
浏览 154

在第一次加载时,jQuery mCustomScrollbars的div高度调整不正确

I have a problem when resizing the height of a div.

I set the height of the div with JavaScript, but it only works when I refresh the page (F5).

How can I get it to work without a refresh?

The code is below:

<script>
$(document).ready(function (){  

    $("#wr1").hide();
    $("#header").hide();

    var aa = $("#wr1").height();
    var bb = aa-80;
    var cc = $("#detail-about1").width();

    $("#detail-about1").css('height',bb);
    $("#wr-close").css('width',cc);

    $(".nav li a").click(function (){
            $("#wr1").slideDown();
            $("#header").slideDown(); 
            $("#footer").slideUp();                                           
            mCustomScrollbars();
        });
});

</script>
  • 写回答

2条回答 默认 最新

  • dpmrakfbx820320638 2012-10-11 04:20
    关注

    whenever you want to call that click work . Trigger it.. Call this line whereever you want it to work

    $(".nav li a").trigger('click');
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?