加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular接受后台HTML (新闻发布系统)

发布时间:2020-12-17 09:58:37 所属栏目:安全 来源:网络整理
导读:后台添加新闻,在angularjs 中显示 问题:由于后台发布的图片不一定能够在手机尺寸中正常显示,解决办法,在页面加载完图片之后, 对图片重现设置样式“宽度90%,居中” 对齐。 //公司介绍内容.state('companyIntroduce.company',{url: '/companyIntroduce/c

后台添加新闻,在angularjs 中显示

问题:由于后台发布的图片不一定能够在手机尺寸中正常显示,解决办法,在页面加载完图片之后,对图片重现设置样式“宽度90%,居中”对齐。

//公司介绍内容
.state('companyIntroduce.company',{
	url: '/companyIntroduce/company',template: '<div ng-bind-html="content"></div><div id="bottom_div_show"></div>',controller: "companyIntroduceIndexCompanyController",//进入页面触发的方法
	onEnter: function () {
		var initImgShow = function(){
			var str=";line-height:1.5rem;color:#535353; width:100%;";
			jQuery("img").attr("style","width:95%;padding: 0px; margin: 0 auto; border: none;display:block");
			jQuery("img").attr("align","center");
			jQuery("div").attr("style","padding: 0px; margin: 0px;with:95%;line-height: 1.5rem;font-size: 1rem;color:#535353;");
			jQuery("p").each(function(){
				var tag=jQuery(this).attr("style")==null;
				if(tag)
				{
					jQuery(this).attr("style",str);
				}
				else
				{
					jQuery(this).attr("style",jQuery(this).attr("style")+str);
				}
		//alert(jQuery(this).attr("style"));
			});
		};
		setTimeout(initImgShow,1000);
	},})

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读