Learn-Helper icon indicating copy to clipboard operation
Learn-Helper copied to clipboard

课程公告的图片拉伸

Open KveinAxel opened this issue 3 years ago • 3 comments

课程公告的图片拉伸好像有点问题,如果上传了个很大的图片就会拉伸。直接打开图片链接是正常的,能扫上。就是直接扫压扁的图片不太行。

Snipaste_2022-09-17_15-26-38

KveinAxel avatar Sep 17 '22 07:09 KveinAxel

这个问题存在比较久了,但我一直没怎么能复现。可能是网络学堂和插件的 CSS 冲突了,有兴趣的话可以在 F12 里面点点看,是谁施加的属性导致计算出了这个高度。

Harry-Chen avatar Sep 17 '22 07:09 Harry-Chen

我看了一下,这个地方加载内容用的是一个iframe,iframe请求包的返回值是这样的

<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>文件预览</title>

</head>

<body class="bg ydl"  style="text-align:center;margin-top:200px;">
	<img style="" src="/f/wlxt/kc/wj_wjb/student/picUrl?*****************************************" />
  <script type="text/javascript" src="/res/app/wlxt/js/jquery.js?v=573"></script>
 <script type="text/javascript" src="/res/app/wlxt/js/kjCommon.js?v=573"></script>
  <script type="text/javascript">
  $(function(){
	  if(self!=top){   
	  	$("body").attr("style","");
	  	$("img").attr("style","width:590px;height:360px;");
	  }
	  removeImg("2020370024_GG_16633994732280784da0069-cc4e-4b84-8beb-2471aa3277bf","");
	  if("mk_kcwj"== "mk_kcgg"&& "0"=="0"  ){
		  saveKjfwb("2020370024_GG_16633994732280784da0069-cc4e-4b84-8beb-2471aa3277bf","0","student");
	  }

      if("mk_kczy"== "mk_kcgg" &&"student"=="student"  && "first" != "" ){
          inserXzsj("2020370024_GG_16633994732280784da0069-cc4e-4b84-8beb-2471aa3277bf");
      }
  });
</script>
</body>

</html>

看到里面是一段jquery设置了宽高限制

if(self!=top){   
    $("body").attr("style","");
    $("img").attr("style","width:590px;height:360px;");
}

KveinAxel avatar Sep 17 '22 07:09 KveinAxel

这就没什么办法了,是网络学堂自己的限制

Harry-Chen avatar Sep 17 '22 12:09 Harry-Chen