1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+
4+ < head >
5+ < meta charset ="UTF-8 ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
8+ < title > Dynamic partition allocation</ title >
9+ < link rel ="icon " href ="../Resource/memory.png " >
10+
11+ < script src ="http://libs.baidu.com/jquery/2.0.0/jquery.min.js "> </ script >
12+ < link rel ="stylesheet " type ="text/css " href ="static/css/style.css ">
13+ < link rel ="stylesheet " type ="text/css " href ="static/css/range.css ">
14+ < script src ="static/js/RangeSlider.js "> </ script >
15+ < script src ="static/js/randColor.js "> </ script >
16+ < script src ="static/js/nextAssingment.js "> </ script >
17+ < script src ="static/js/clear.js "> </ script >
18+ </ head >
19+
20+ < body >
21+
22+ <!--项目标题-->
23+ < div class ="container " style ="margin-top: 8%;text-align: center;font-size: 35px; ">
24+ < strong > 动态分区分配方式模拟</ strong >
25+ </ div >
26+
27+ <!--模拟内存(可以动态调节大小 & 动态增加作业)-->
28+ < div class ="container ">
29+ < center >
30+ < div class ="memory " id ="memory ">
31+
32+ </ div >
33+ </ center >
34+ </ div >
35+
36+ < div class ="container " style ="display: flex; margin-top: 3%;margin-left: 16%; ">
37+ <!--下拉框(选择分区算法)-->
38+ < div class ="algorithm "">
39+ < div > 请选择分区分配算法</ div >
40+ < div class =" model-box " style ="width:180px; margin-top: 5px; ">
41+ < div id ="box " class ="model-select-text " data-value ="首次适应算法 "> 首次适应算法</ div >
42+
43+ < ul class ="model-select-option ">
44+ < li data-option ="首次适应算法 "> 首次适应算法</ li >
45+ < li data-option ="最佳适应算法 "> 最佳适应算法</ li >
46+ </ ul >
47+ </ div >
48+ </ div >
49+
50+ <!--滑动条(动态调节内存大小)-->
51+ < div class ="memory-size " id ="memory-size " style ="margin-left: 100px; ">
52+ < div style ="display: inline-flex; "> 请选择内存空间大小       
53+ < div id ="current-size "> 200</ div >
54+ K</ div >
55+
56+ < div class ="range-slider " style ="margin-top: 10px; ">
57+ < input id ="slider " type ="range " value ="200 " min ="200 " max ="1000 " step ="20 ">
58+ </ div >
59+ </ div >
60+
61+ <!--执行下一指令-->
62+ < div class ="next-btn " style ="margin-left: 100px ">
63+ < button style ="border-color: rgb(50, 196, 233);background-color: rgb(50, 196, 233);
64+ height: 45px; width: 70px; " onclick ="nextAssignment() ">
65+ 下一步
66+ </ button >
67+ </ div >
68+
69+ <!--清空内存-->
70+ < div class ="clear-btn ">
71+ < button style ="border-color: rgb(252, 0, 0);background-color: rgb(252, 0, 0);
72+ height: 45px; width: 70px; " onclick ="clearbtnClick() ">
73+ 清空内存
74+ </ button >
75+ </ div >
76+ </ div >
77+
78+ <!--日志信息滚动窗口-->
79+ < div class ="container " style ="margin-top: 3%; ">
80+ < center >
81+ < div > 日志信息</ div >
82+ < div id ="board " style ="height: 150px;width: 500px;background-color: #C1BDA3;
83+ overflow:auto; ">
84+ </ div >
85+ </ center >
86+ </ div >
87+
88+ < script >
89+ //滑动条改变触发事件
90+ var change = function ( $input ) {
91+ console . log ( $input . value )
92+ //将slider的值进行函数映射
93+ document . getElementById ( 'current-size' ) . innerHTML = $input . value ;
94+ document . getElementById ( 'memory' ) . style . width = String ( $input . value ) + "px" ;
95+ }
96+
97+ $ ( 'input' ) . RangeSlider ( {
98+ min : 200 ,
99+ max : 1000 ,
100+ step : 20 ,
101+ callback : change
102+ } ) ;
103+ </ script >
104+
105+ </ body >
106+
107+ < script src ="https://cdn.bootcss.com/jquery/3.2.1/jquery.js "> </ script >
108+ < script src ="static/js/select.js "> </ script >
109+
110+ </ html >
0 commit comments