All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
PHP基础:PHP4和PHP5的配置异同比较_[PHP教程]
include()和require()的区别_[PHP教程]
验证控件的气泡提示效果_[Asp.Net教程]
ASP.NET2.0学习历程,菜鸟到中级程序员的飞跃--30本好书点评_[Asp.Net教程]
ASP.NET中绑定枚举类型_.net资料_编程技术
为Linux和Windows安装PHP和Oracle_[PHP教程]
用PHP操作MySql数据库(DB类)_[PHP教程]
xml的解析处理以及其他_[XML教程]
用XMLHTTP对象抓取网页源代码,拆分数据写入数据库_[XML教程]
XHTML+CSS标准网页-调用样式表_[Html教程]
Reading number is top 10 pictures
妹子最好别玩单反
Sanya, hainan Haitian party feast promiscuity
Steal to eat bacon bird
The real super beauty9
中国女孩大胆自拍,显露完美身材4
A man's favorite things6
Sora aoi be huged like a bear
接财神,大吉大利,财源滚滚来
西游四格漫画(三)
29 the belle stars after bath figure4
Download software ranking
Eclipse 4.2.2 For Win32
VC++6.0培训教程
Call Of Duty5
网络管理员第三版
Sora aoi - one of more PK
功夫熊猫2(下集)
传奇私服架设教程
Tram sex maniac 2 (H) rar bag3
The cock of the Grosvenor LTD handsome
Ashlynn Video5
归海一刀 published in(发表于) 2014/3/30 5:35:35 Edit(编辑)
用ASP+CSS实现网页随机背景_[Html教程]

用ASP+CSS实现网页随机背景_[Html教程]

用ASP+CSS实现网页随机背景_[Html教程]

  随机背景--当你每次进入该页面时,从已指定的图片文件夹中,随机选取一个图片作为背景显示。这里介绍的方法是用ASP+CSS来实现的。

  ASP源代码:

  Const imgS_DIR = "/images"
  '设定图片文件夹的地址,随机显示该文件夹内任一张图片
  Dim objFSO, objFolderObject, objFileCollection, objFile
  Dim intFileNumberToUse, intFileLooper
  Dim objImageFileToUse
  Dim strImageSrcText
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  Set objFolderObject = objFSO.GetFolder(Server.MapPath(imgS_DIR))
  Set objFSO = Nothing
  Set objFileCollection = objFolderObject.Files
  Set objFolderObject = Nothing
  Randomize()
  intFileNumberToUse = Int(objFileCollection.Count * Rnd) + 1
  intFileLooper = 1
  For Each objFile in objFileCollection
  If intFileLooper = intFileNumberToUse Then
  Set objImageFileToUse = objFile
  Exit For
  End If
  intFileLooper = intFileLooper + 1
  Next
  Set objFileCollection = Nothing
  strImageSrcText = imgS_DIR & objImageFileToUse.Name
  Set objImageFileToUse = Nothing

  #pic{
  width: 400px;
  height: 300px;
  background: url() no-repeat;
  margin: 2em auto;
  }

  上面代码要加在head区,不能放在外部CSS文件里。

  CSS源代码:


 
 
 
 
 


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.