var px = $('#sampleDiv').css('marginLeft'); var num= parseInt( $('#sampleDiv').css('marginLeft') ); 转载于:https://www.cnblogs.com/cjbk/p/5159495.html