SchoolPhysicalExamination/public/children_meals_cookbook/12岁以上青少年长高食谱/12岁以上青少年长高食谱.html

65 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0 0;
padding: 0 0;
}
#big_box{
width: 100vw;
}
#down_file{
width: 100vw;
height: 20vw;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
}
img{
display: block;
width: 100%;
}
a{
width: 100vw;
text-align: center;
line-height: 10vw;
}
</style>
<script>
var title = '12岁以上青少年长高食谱'
document.addEventListener('DOMContentLoaded', function() {
// Change the page title
document.title = title;
// Insert 48 images in the img_box div
const imgBox = document.getElementById('img_box');
for (let i = 1; i <= 48; i++) {
const img = document.createElement('img');
img.src = `./img/9861b4373f4d41051ea7a931b882e767-${i}.jpg`;
img.alt = `Recipe image ${i}`;
imgBox.appendChild(img);
}
// Update the download link to PDF with forced download
const downloadLink = document.querySelector('#down_file a');
downloadLink.href = 'http://wm.reedaw.com/children_meals_cookbook/'+title+'/'+title+'.pdf';
downloadLink.setAttribute('download', '12岁以上青少年长高食谱.pdf');
downloadLink.textContent = '点击下载文件';
});
</script>
</head>
<body>
<div id="big_box">
<div id="img_box"></div>
<div id="down_file">
<a href=""></a>
</div>
</div>
</body>
</html>