div内的中英文字符串换行问题
来源:互联网 发布:恒久网络 编辑:程序博客网 时间:2024/05/17 20:33
用HTML加javascript实现打字机样的效果…当字符串为英文时无法自动换行…中文时可以自动换行
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> test typing </title>
<script type="text/javascript" src="js/temp.js">
</script>
</head>
<body>
<div id="myDiv" style="width:200px; height:100px; border:2px #ccc dashed; padding:10px"></div>
<script>
var typingText = "abcdefghijklmnopqrstuvwxyzwhy中文字符可以自动换行不会超过边框";
var count = 0;
var myBlock = document.getElementById("myDiv");
function type(){
if(count <= typingText.length){
myBlock.innerHTML = typingText.substring(0, count);
count++;
}else{
window.clearInterval(intervalID);
}
}
var intervalID = window.setInterval(type, 200);
</script>
</body>
</html>
- div内的中英文字符串换行问题
- div中英文无法自动换行的解决办法
- div中英文无法自动换行的解决办法
- 将中英文混合的字符串换行
- 将中英文混合的字符串换行 (续)
- 解决notepad++中英文混编的换行问题
- 固定宽度的DIV中英文不能自动换行
- 固定宽度的DIV中英文不能自动换行
- 固定宽度的DIV中英文不能自动换行
- 固定宽度的DIV中英文不能自动换行
- CSS中英文换行问题
- 在HTML中英文换行问题
- android text 中英文混排 换行的问题
- JustifyTextView 解决TextView中英文混排自动换行的问题
- 解决table中英文和数字不能换行的问题
- 双引号内字符串换行
- div内的内容超出则自动换行
- 如何可以让div内的元素不换行?
- 二分图的判定
- JS 进制转换
- bzoj1188[HNOI2007]分裂游戏
- ibatis <sql>和<include>
- spring实现读写分开
- div内的中英文字符串换行问题
- JavaScript与ECMAScript
- Linux学习篇之~unit6
- SQL_case when语法
- iOS开源项目周报0406
- Java_读写CSV文件
- 大臣的旅费--深度优先遍历 JAVA
- 获取canvas的宽高及重置
- js_获取日期:前天、昨天、今天、明天、后天