zoukankan      html  css  js  c++  java
  • 滚动公告(纵向)

    <!DOCTYPE html>
    <html>
    
    	<head>
    		<meta charset="UTF-8">
    		<title></title>
    		<style type="text/css">
    			.case {
    				position: absolute;
    				 800px;
    				height: 30px;
    				overflow: hidden;
    				left: calc(50% - 400px);
    				top: 150px;
    			}
    			
    			.case .part1 {
    				float: left;
    				 5%;
    				height: 30px;
    			}
    			
    			.case .part1 img {
    				 20px;
    				height: 20px;
    				float: right;
    				margin-top: 5px;
    			}
    			
    			.case .part2 {
    				float: left;
    				 93%;
    				height: 30px;
    				text-indent: 1em;
    				overflow: hidden;
    			}
    			
    			#part2 ul {
    				 100%;
    				height: auto;
    				list-style: none;
    				padding: 0;
    				margin: 0;
    			}
    			
    			#part2 ul li {
    				 100%;
    				height: 30px;
    				font-size: 16px;
    				line-height: 30px;
    				color: #575757;
    				overflow: hidden;
    				white-space: nowrap;
    				text-overflow: ellipsis;
    			}
    		</style>
    	</head>
    
    	<body>
    		<div class="case">
    			<div class="part1"> <img src="../img/notice.png">//一个喇叭的图片 </div>
    			<div class="part2" id="part2">
    				<div id="scroll1">
    					<ul>
    						<li>不要被别人表现出来的毫不费力所迷惑,你要知道,那些信手拈来的东西,一定有拼尽全力作为支撑。</li>
    						<li>这个世界上,天才好像真的没有那么多。</li>
    						<li>而我希望,自己也可以在别人看不见的地方不动声色的努力,在关键时刻出其不意的傲娇绽放。</li>
    						<li>这个年纪我不在将就。</li>
    					</ul>
    				</div>
    				<div id="scroll2"></div>
    			</div>
    		</div>
    		<script type="text/javascript">
    			var PartArea = document.getElementById('part2');
    			var Scroll1 = document.getElementById('scroll1');
    			var Scroll2 = document.getElementById('scroll2');
    
    			Scroll2.innerHTML = Scroll1.innerHTML;
    
    			function roll() {
    				if(Scroll2.offsetHeight - PartArea.scrollTop <= 0) {
    					PartArea.scrollTop -= Scroll1.offsetHeight;
    				} else {
    					PartArea.scrollTop++;
    				}
    			}
    
    			var StopRoll = setInterval(roll, 60);
    
    			PartArea.onmouseover = function() {
    				clearInterval(StopRoll);
    			}
    			PartArea.onmouseout = function() {
    				StopRoll = setInterval(roll, 60);
    			}
    		</script>
    	</body>
    
    </html>
    
  • 相关阅读:
    mac 使用brew 安装php-redis
    thinkphp6 使用redis 实现消息队列
    Redis 桌面管理器:Another Redis Desktop Manager
    linux 查看并关闭shell脚本执行
    MySQL教程之concat以及group_concat的用法
    PHP redis 使用
    thinkphp6 command(自定义指令)
    git 使用
    linux shell中 "2>&1"含义
    linux crontab 定时任务
  • 原文地址:https://www.cnblogs.com/gxywb/p/10024573.html
Copyright © 2011-2022 走看看