Home Web Front-end JS Tutorial Introduction to how JavaScript implements automatic scrolling of Select list content

Introduction to how JavaScript implements automatic scrolling of Select list content

Sep 08, 2017 am 11:26 AM
javascript js select

本文实例讲述了js实现Select列表内容自动滚动效果。分享给大家供大家参考。具体如下:

这里演示的Select列表内容自动滚动效果,文字可自动滚屏,当网页加载完毕后,Select中的内容会一个接一个向上滚动,当然,滚动的参数和速度是可以调节的。或许你会用得上。

运行效果截图如下:

在线演示地址如下:

http://demo.jb51.net/js/2015/js-select-font-scroll-codes/

具体代码如下:

<html>
<head>
<title>文字自动滚屏</title>
</head>
<body onLoad="screenscroll();">
<SCRIPT LANGUAGE="JavaScript">
function screenscroll(){
 var optlist = document.form1.Text1;
 optlist[0] = null;
 optlist.selectedIndex = 0;
 setTimeout("screenscroll()",2000);
}
</script>
<form name="form1">
<select name="Text1" size=8>
<option>
<option>世界名著及作者
<option>乌托邦 作者:莫 尔
<option>威尼斯商人 作者:莎士比亚
<option>简.爱 作者:夏绿蒂.勃朗特
<option>唐璜 作者:拜 伦
<option>呼啸山庄 作者:艾米莉.勃朗特
<option>鲁宾逊飘流记 作者:笛 福
<option>名利场 作者:萨克雷
<option>傲慢与偏见 作者:简.奥斯丁
<option>双城记 作者:查尔斯.狄更斯
<option>恋爱中的女人 作者:D.H.劳伦斯
<option>新工具 作者:培 根
<option>政府论 作者:洛 克
<option>尤里西斯 作者:詹姆斯.乔伊斯
<option>赫克尔贝里.芬历险记 作者:马克.吐温
<option>老人与海 作者:海明威
<option>飘 作者:玛格丽特.米切尔
<option>嘉莉妹妹 作者:德莱塞
<option>小妇人 作者:路易莎.梅.奥尔科特
<option>悲惨世界 作者:雨果
<option>约翰.克里斯朵夫 作者:罗曼.罗兰
<option>幻灭 作者:巴尔扎克
<option>欧叶妮.格朗台 作者:巴尔扎克
<option>贝姨 作者:巴尔扎克
<option>邦斯舅舅 作者:巴尔扎克
<option>格兰特船长的儿女 作者:儒勒.凡尔纳
<option>漂亮朋友 作者:莫泊桑
<option>娜娜 作者:左 拉
<option>包法利夫人 作者:福楼拜
<option>基督山伯爵 作者:大仲马
<option>茶花女 作者:小仲马
<option>巴黎圣母院 作者:雨 果
<option>红与黑 作者:司汤达
<option>拿破仑法典 作者: 拿破仑
<option>人是机器 作者:拉美特里
<option>社会契约论 作者:卢 梭
<option>浮士德 作者:歌 德
<option>少年维特的烦恼 作者:歌 德
<option>希腊神话故事 作者:施瓦布
<option>战争论 作者:克劳塞维茨
<option>忏悔录 作者:奥古斯丁
<option>父与子 作者:屠格涅夫
<option>罪与罚 作者:陀思妥耶夫斯基
<option>安娜.卡列宁娜 作者:列夫.托尔斯泰
<option>复活 作者:列夫.托尔斯泰
<option>上尉的女儿 作者:普希金
<option>死魂灵 作者:果戈理
<option>童年 作者:高尔基
<option>我的大学 作者:高尔基
<option>钢铁是怎样炼成的 作者:尼.奥斯特洛夫斯基
<option>白痴 作者:陀思妥耶夫斯基
<option>伊索寓言 作者:伊索.拉封丹
<option>理想国 作者:柏拉图
<option>政治学 作者:亚里士多德
<option>安徒生童话 作者:安徒生
<option>牛虻 作者:伏尼契
<option>堂.吉诃德 作者:塞万提斯
<option>汉穆拉比法典 作者:汉穆拉比
<option>论神 作者:斯宾诺莎
<option>癞皮鹦鹉 作者:利萨尔迪
<option>* 作者:康帕内拉
<option>性爱与文明 作者:弗洛伊德
<option>苔丝 作者:哈代
<option>拉摩的侄儿 作者:狄德罗
<option>理智与情感 作者:奥斯汀
<option>权力意志 作者:尼采
<option>苦闷的象征 作者:厨川白村
<option>梦的解析 作者:弗各伊德
<option>资本论 作者:马克思
<option>先知 作者:纪伯伦
<option>俄罗斯的童话 作者:高尔基
<option>桃色的云 作者:爱罗先轲
<option>水晶瓶塞 作者:莫里斯.勒布朗
<option>乡村医生 作者:巴尔扎克
<option>高龙巴 作者:梅里美
<option>黄室奇案 作者:嘉斯东.勒鲁
<option>克菜采奏鸣曲 作者:列.托尔斯泰
<option>阴谋与爱情 作者:席勒
<option>快乐王子 作者:王尔德
<option>变形记 作者:卡夫卡
<option>羊脂球 作者:莫泊桑
<option>魔沼 作者:乔治.桑
<option>死魂灵 作者:果戈里
<option>希腊棺材之谜 作者:奎恩
<option>母亲 作者:高尔基
<option>被背叛的遗嘱 作者:米兰.昆德拉
<option>毁灭 作者:法捷耶夫
<option>绞刑架下的报告 作者:伏契克
<option>贵族之家 作者:屠格涅夫
<option>冷血医生 作者:玛丽.希金斯.克拉克
<option>十日谈 作者:薄伽丘
<option>女富翁的遗产 作者:高木彬光
<option>绿野仙踪 作者:莱曼.弗兰.鲍姆
<option>法国中尉的女人 作者:约翰.福尔斯
<option>汤姆.索亚历险记 作者:马克.吐温
<option>马可.波罗游记 作者:马可.波罗
<option>卡门 作者:梅里美
<option>.美丽与悲哀 作者:川端康成
<option>野性的呼唤 作者:杰克.伦敦
<option>吉卜赛姑娘 作者:塞万提斯
<option>浅滩迷船 作者:里縸
</select>
</form>
</body>
</html>
Copy after login

The above is the detailed content of Introduction to how JavaScript implements automatic scrolling of Select list content. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to implement an online speech recognition system using WebSocket and JavaScript How to implement an online speech recognition system using WebSocket and JavaScript Dec 17, 2023 pm 02:54 PM

How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

Recommended: Excellent JS open source face detection and recognition project Recommended: Excellent JS open source face detection and recognition project Apr 03, 2024 am 11:55 AM

Face detection and recognition technology is already a relatively mature and widely used technology. Currently, the most widely used Internet application language is JS. Implementing face detection and recognition on the Web front-end has advantages and disadvantages compared to back-end face recognition. Advantages include reducing network interaction and real-time recognition, which greatly shortens user waiting time and improves user experience; disadvantages include: being limited by model size, the accuracy is also limited. How to use js to implement face detection on the web? In order to implement face recognition on the Web, you need to be familiar with related programming languages ​​and technologies, such as JavaScript, HTML, CSS, WebRTC, etc. At the same time, you also need to master relevant computer vision and artificial intelligence technologies. It is worth noting that due to the design of the Web side

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems WebSocket and JavaScript: key technologies for implementing real-time monitoring systems Dec 17, 2023 pm 05:30 PM

WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS Dec 17, 2023 pm 06:55 PM

Essential tools for stock analysis: Learn the steps to draw candle charts in PHP and JS. Specific code examples are required. With the rapid development of the Internet and technology, stock trading has become one of the important ways for many investors. Stock analysis is an important part of investor decision-making, and candle charts are widely used in technical analysis. Learning how to draw candle charts using PHP and JS will provide investors with more intuitive information to help them make better decisions. A candlestick chart is a technical chart that displays stock prices in the form of candlesticks. It shows the stock price

How to use JavaScript and WebSocket to implement a real-time online ordering system How to use JavaScript and WebSocket to implement a real-time online ordering system Dec 17, 2023 pm 12:09 PM

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

JavaScript and WebSocket: Building an efficient real-time weather forecasting system JavaScript and WebSocket: Building an efficient real-time weather forecasting system Dec 17, 2023 pm 05:13 PM

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

Simple JavaScript Tutorial: How to Get HTTP Status Code Simple JavaScript Tutorial: How to Get HTTP Status Code Jan 05, 2024 pm 06:08 PM

JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest

PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts Dec 18, 2023 pm 03:39 PM

With the rapid development of Internet finance, stock investment has become the choice of more and more people. In stock trading, candle charts are a commonly used technical analysis method. It can show the changing trend of stock prices and help investors make more accurate decisions. This article will introduce the development skills of PHP and JS, lead readers to understand how to draw stock candle charts, and provide specific code examples. 1. Understanding Stock Candle Charts Before introducing how to draw stock candle charts, we first need to understand what a candle chart is. Candlestick charts were developed by the Japanese

See all articles