简体   繁体   中英

CSS calc doesn't work on Chrome and Firefox

I have div which have id name is #monthlyconfirm_grid. I used that Jquery process to control scroll from gridview but it works only on IE and doesn't work on Chrome and firefox.

$(document).ready(function () {
            var expi = $("#monthlyconfirm_grid").scrollLeft - 2;
            var expr = "calc("+ expi +")";
            $(".locked").css("left", expr);

});

PS: I used <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> to work on IE.

Why doesn't work on chrome and Firefox? How can I solve that?

scrollLeft是一个函数,所以你还需要使用括号:

var expi = $("#monthlyconfirm_grid").scrollLeft() - 2;

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