$(function(){ var myhtml = ''; for(var i = 0;i'+ ''+ ''+ ''+ ''+ '
  • '+ ''+titlearr[i]+''+ ''+'删除'+''+ '
  • '+ '' } $('.waterfall').html(myhtml); $('#protitle').html(protitle);//+'上传' $(document).on('click','.delete',function(){ if($('.waterfall').children().length>1){ $(this).parent().parent().remove(); }else{ alert('只剩最后一项了...'); } }) // console.log(document.documentElement.clientWidth,'width'); if(document.documentElement.clientWidth<=600){ var left = document.documentElement.clientWidth - 271; $('.list-group').css('marginLeft',left*0.38+'px'); // $('.list-group').css('float','right'); } })