我有这个功能PHP
,它来自我正在工作的一个项目:
foreach ($reports["included_reports"] as $index => $report_name ) {
if (! in_array( $report_name, $reports["excluded_reports"])) {
$optional_reports .=
"<div class=\"large-12 columns\">
<div class=\"panel\">
<a href=\"./graph_all_periods.php?$graph_args&g=". $report_name ."&height=???&width=???\">
<img BORDER=0 style=\"padding:2px;\" $additional_cluster_img_html_args title=\"$cluster_url\" SRC=\"./graph.php?$graph_args&g=". $report_name ."&height=???&width=???\" >
</a>
</div>
</div>";
}
}
我想调整图像的大小以填充我的 div,但我不能使用width:100%
,因为我必须通知width
和height
PHP。但是 PHP 是先执行的,我也不知道用户监视器的分辨率。在谷歌搜索我发现我只能通过 JavaScipt 知道用户显示器的分辨率。所以我想知道是否有可能做一些我可以知道用户监控并通知我width
和标签中的heigh
参数的事情。img