Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM-07
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
JM-07
Commits
9fa8b6aa
Commit
9fa8b6aa
authored
Aug 12, 2021
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:增加标题字体缩放
parent
da264751
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
index.html
play/index.html
+1
-1
index.js
play/index.js
+20
-0
No files found.
play/index.html
View file @
9fa8b6aa
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<div
class=
"content"
>
<div
class=
"content"
>
<input
type=
"hidden"
id=
'keyWord'
>
<input
type=
"hidden"
id=
'keyWord'
>
<div
style=
"position: absolute; top: 0.25rem; left: 10%; z-index: 99;"
>
<div
style=
"position: absolute; top: 0.25rem; left: 10%; z-index: 99;"
>
<
span
class=
"title"
>
请同学们根据视频复述课文
</span
>
<
p
class=
"title"
>
请同学们根据视频复述课文
</p
>
</div>
</div>
<div
role=
"tea"
id=
"tea"
>
<div
role=
"tea"
id=
"tea"
>
...
...
play/index.js
View file @
9fa8b6aa
...
@@ -280,6 +280,9 @@ class PlayView {
...
@@ -280,6 +280,9 @@ class PlayView {
$
(
"
.title
"
).
append
(
this
.
data
.
title
);
$
(
"
.title
"
).
append
(
this
.
data
.
title
);
}
}
//改变字体大小
changeFontSize
(
$
(
"
.title
"
));
$
(
"
#keyWord
"
).
val
(
this
.
data
.
keyWord
);
$
(
"
#keyWord
"
).
val
(
this
.
data
.
keyWord
);
if
(
ROLE
==
"
tea
"
)
{
if
(
ROLE
==
"
tea
"
)
{
...
@@ -314,6 +317,23 @@ class PlayView {
...
@@ -314,6 +317,23 @@ class PlayView {
}
}
}
}
function
changeFontSize
(
_dom
){
const
txtLen
=
_dom
.
width
();
console
.
log
(
"
text length:
"
,
txtLen
);
if
(
txtLen
<
520
){
_dom
.
css
(
"
font-size
"
,
"
0.7rem
"
);
}
else
if
(
txtLen
<
600
)
{
_dom
.
css
(
"
font-size
"
,
"
0.60rem
"
);
}
else
if
(
txtLen
<
700
)
{
_dom
.
css
(
"
font-size
"
,
"
0.55rem
"
);
}
else
if
(
txtLen
<
800
)
{
_dom
.
css
(
"
font-size
"
,
"
0.50rem
"
);
}
else
{
_dom
.
css
(
"
font-size
"
,
"
0.45rem
"
);
}
}
/**
/**
*
*
* @param {*} aspect 断线恢复
* @param {*} aspect 断线恢复
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment