Initial commit: 教务系统在线平台
- 包含4个产业方向的前端项目:智能开发、智能制造、大健康、财经商贸 - 已清理node_modules、.yoyo等大文件,项目大小从2.6GB优化至631MB - 配置完善的.gitignore文件 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
60
frontend_智能开发/test-scroll.html
Normal file
60
frontend_智能开发/test-scroll.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.container {
|
||||
width: 1120px;
|
||||
background-color: #fff;
|
||||
padding: 20px 15px;
|
||||
margin: 20px auto;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
border: 2px solid red;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.item {
|
||||
flex: 0 0 164px;
|
||||
width: 164px;
|
||||
height: 260px;
|
||||
background: #4096ff;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2>测试横向滚动</h2>
|
||||
<div class="scroll-container" id="scrollContainer">
|
||||
<!-- 将通过JS动态添加72个元素 -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const container = document.getElementById('scrollContainer');
|
||||
for (let i = 1; i <= 72; i++) {
|
||||
const item = document.createElement('div');
|
||||
item.className = 'item';
|
||||
item.textContent = `课程 ${i}`;
|
||||
container.appendChild(item);
|
||||
}
|
||||
|
||||
console.log('容器宽度:', container.offsetWidth);
|
||||
console.log('内容宽度:', container.scrollWidth);
|
||||
console.log('可滚动宽度:', container.scrollWidth - container.offsetWidth);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user