随机显示广告图片

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>随机显示广告图片</title>
</head>
<body>

<script>
    advertisement = new Array(4);
    advertisement[0] = ‘<img src="http://www.lanrentuku.com/down/js/images/12498863530.jpg" />‘;
    advertisement[1] = ‘<img src="http://www.lanrentuku.com/down/js/images/12498863531.jpg" />‘;
    advertisement[2] = ‘<img src="http://www.lanrentuku.com/down/js/images/12498863532.jpg" />‘;
    advertisement[3] = ‘<img src="http://www.lanrentuku.com/down/js/images/12498863533.jpg" />‘;
    var index = Math.floor(Math.random() * advertisement.length);
    document.write(advertisement[index]);
</script>

<p>刷新下看看效果吧~</p>

</body>
</html>
时间: 2024-12-23 13:47:41

随机显示广告图片的相关文章

使用jquery完成定时弹出广告图片

<script src="../js/jquery-1.8.3.js"></script> <script type="text/javascript"> $(function(){ //1.书写显示广告的定时操作 time=setInterval("showAdd()",3000); }); //2.书写显示广告图片的函数 function showAdd(){ //3.获取广告图片,并让其显示 // $(&

JS实现的随机显示图片

1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 "http://www.w3.org/TR/xhtml1/TDT/xhtml1-strit.dtd"> 3 <html> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html;charset=utf-8&q

jquery实现的随机显示图片效果代码

jquery实现的随机显示图片效果代码:下面介绍一下,点击按钮就可以实现图片的随机切换效果,代码实现非常的简单.代码实例如下: <!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <head> <tit

在InternetExplorer.Application中显示本地图片

忘记了,喜欢一个人的感觉 Demon's Blog  ?  程序设计  ?  在InternetExplorer.Application中显示本地图片 ? 对VBS效率的再思考--处理二进制数据 WordPress判断用户是否登录 ? 在InternetExplorer.Application中显示本地图片 标题: 在InternetExplorer.Application中显示本地图片作者: Demon链接: http://demon.tw/programming/internetexplor

随机显示星星(点击可删除)【转】

<!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> <title>随机显示星星</title>

Android实现Banner界面广告图片循环轮播(包括实现手动滑动循环)

前言:经常会看到有一些app的banner界面可以实现循环播放多个广告图片和手动滑动循环.本以为单纯的ViewPager就可以实现这些功能.但是蛋疼的事情来了,ViewPager并不支持循环翻页.所以要实现循环还得需要自己去动手.自己在网上也找了些例子,本博文的Demo是结合自己找到的一些相关例子的基础上去改造,也希望对读者有用. Demo实现的效果图如下: Demo代码: 工程目录如下图: 废话不多说,上代码. 1.主Activity代码如下: [java] view plaincopy pa

java实现随机验证码的图片

链接地址:http://blog.sina.com.cn/s/blog_407a68fc010006qo.html 1.一共需要2个常用java文件(RandomCode.java和RandomCodeCtrl.java): (a.)RandomCode.java是个普通的java文件:内容如下: import java.awt.Color;import java.awt.Font;import java.awt.Graphics;import java.awt.image.BufferedIm

Django随机生成验证码图片

PIL简介 什么是PIL PIL:是Python Image Library的缩写,图像处理的模块.主要的类包括Image,ImageFont,ImageDraw,ImageFilter PIL的导入 首先需要安装一下pillow包 ? 1 pip install pillow 然后就可以调用PIL里的类了 ? 1 2 3 4 from PIL import Image from PIL import ImageFont from PIL import ImageDraw from PIL im

Linux framebuffer显示bmp图片

framebuffer简介     帧缓冲(framebuffer)是Linux为显示设备提供的一个接口,把显存抽象后的一种设备,他允许上层应用程序在图形模式下直接对显示缓冲区进行读写操作.framebuffer是LCD对应的一中HAL(硬件抽象层),提供抽象的,统一的接口操作,用户不必关心硬件层是怎么实施的.这些都是由Framebuffer设备驱动来完成的.     帧缓冲设备对应的设备文件为/dev/fb*,如果系统有多个显示卡,Linux下还可支持多个帧缓冲设备,最多可达32个,分别为/d