JS and ASP display the picture in the database

Source: Internet
Author: User
Tags eval
js| Data | database | display <table width= "100%" border= "0" align= "center" cellspacing= "0" cellpadding= "0" style= "table-layout: Fixed ">
<%
Sql= "SELECT Top 4 * from Ad where checked=true"
Rs. Open sql,conn,1,1
If not rs.eof then
N=0
While not Rs. Eof
N=n+1
%>
<%=rs ("Adsitepic")%>
<%
Rs. MoveNext
Wend
%>
Width= "100%" height= "&LT;TD" >
<script language= "JavaScript1.2" >

var slideshow_width= ' 200px '//set slideshow width (SET to largest image ' s width if multiple dimensions)
var slideshow_height= ' 200px '//set slideshow height (SET to largest image ' s height if multiple dimensions)
var pause=3000//set pause BETWEEN SLIDE (2000=2 seconds)
var slidebgcolor= "White"

var dropimages=new Array ()

dropimages[0]= " "width=" 128 "height=" 128 ">"
dropimages[1]= " "width=" 128 "height=" 128 ">"
dropimages[2]= " "width=" 128 "height=" 128 ">"

var droplinks=new Array ()

Droplinks[0]=www.airsend.com
Droplinks[1]=www.sina.com
Droplinks[2]=www.baidu.com

var preloadedimages=new Array ()
for (p=0;p<dropimages.length;p++) {
Preloadedimages[p]=new Image ()
PRELOADEDIMAGES[P].SRC=DROPIMAGES[P]
}

var Ie4=document.all
var Dom=document.getelementbyid

if (ie4| | Dom
document.write (' <div style= ' position:relative;width: ' +slideshow_width+ '; height: ' +slideshow_height+ '; overflow : Hidden "><div id=" Canvas0 "style=" position:absolute;width: ' +slideshow_width+ '; height: ' +slideshow_height+ '; Background-color: ' +slidebgcolor+ '; left:-' +slideshow_width+ ' "></div><div id=" canvas1 "style=" position : absolute;width: ' +slideshow_width+ '; height: ' +slideshow_height+ '; Background-color: ' +slidebgcolor+ '; left:-' + slideshow_width+ ' "></div></div>")
Else
document.write (' <a href= "Javascript:rotatelink ()" ></a> ')

var curpos=parseint (slideshow_width) * (-1)
var degree=10
var curcanvas= "Canvas0"
var curimageindex=linkindex=0
var nextimageindex=1


function Movepic () {
if (curpos<0) {
Curpos=math.min (curpos+degree,0)
tempobj.style.left=curpos+ "px"
}
else{

Clearinterval (Dropslide)
Nextcanvas= (curcanvas== "Canvas0")? "Canvas0": "CANVAS1"
Tempobj=ie4? Eval ("document.all.") +nextcanvas): document.getElementById (Nextcanvas)
var slideimage= ' '
Tempobj.innerhtml= (droplinks[curimageindex]!= "")? ' <a href= ' +droplinks[curimageindex]+ ' > ' +slideimage+ ' </a> ': slideimage
nextimageindex= (nextimageindex<dropimages.length-1)? nextimageindex+1:0
SetTimeout ("Rotateimage ()", pause)
}
}

function Rotateimage () {
if (ie4| | DOM) {
Resetit (Curcanvas)
var crossobj=tempobj=ie4? Eval ("document.all.") +curcanvas): document.getElementById (Curcanvas)
crossobj.style.zindex++
var temp= ' SetInterval ("Movepic ()", 50) '
Dropslide=eval (temp)
Curcanvas= (curcanvas== "Canvas0")? "CANVAS1": "Canvas0"
}
Else
Document.images.defaultslide.src=dropimages[curimageindex]
Linkindex=curimageindex
curimageindex= (curimageindex<dropimages.length-1)? curimageindex+1:0
}

function Rotatelink () {
if (droplinks[linkindex]!= "")
Window.location=droplinks[linkindex]
}

function Resetit (what) {
Curpos=parseint (slideshow_width) * (-1)
var crossobj=ie4? Eval ("document.all.") +what): document.getElementById (what)
crossobj.style.left=curpos+ "px"
}

function Startit () {
var crossobj=ie4? Eval ("document.all.") +curcanvas): document.getElementById (Curcanvas)
Crossobj.innerhtml= ' <a href= ' +droplinks[curimageindex]+ ' ></a> '
Rotateimage ()
}

if (ie4| | Dom
Window.onload=startit
Else



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.