Hola amigos ... e estado buscando alguna forma de poner un rotador de imagenes en mi pagina en ASP pero por alguna extraña razon los codigos que he implementado no funcionan.. ni jquery ni javascript....
tengo esta funcion que me cambia la imagen cada ves que se refresca la imagen
Código HTML:
<script type="text/javascript" language="vbscript">
<%
Function RandomImage(strPath)
On Error Resume Next
Randomize Timer
' declare all variables
Dim objFSO, objFolder, objFiles, objFile
Dim strFiles, strImages, strPhysical, strFile
' this constant has the names of valid image file name
' extensions and can be modified for more image types
Const strValid = ".gif.jpg.png"
' make sure we have a trailing slash in the path
If Right(strPath,1) <> Chr(47) Then strPath = strPath & Chr(47)
' get the physical path of the folder
strPhysical = Server.MapPath(strPath)
' get a File System Object
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
' create a folder object
Set objFolder = objFSO.GetFolder(strPhysical)
' get the files collection
Set objFiles = objFolder.Files
' enumerate the files collection looking for images
For Each objFile in objFiles
strFile = LCase(objFile.Name)
If Instr(strValid,Right(strFile,4)) Then
' add vaild images to a string of image names
strFiles = strFiles & strFile & vbTab
End If
Next
' split the image names into an array
strImages = Split(strFiles,vbTab)
' if we have an array...
If UBound(strImages) > 1 Then
' get a random name
RandomImage = strPath & strImages(Int(Rnd(1)*UBound(strImages)))
Else
' otherwise return the default
RandomImage = strDefault
End If
End Function
%>
</script>
casi no se vbscript.. pero quisiera que ayudaran en como puedo modificar esa funcion para que cada cierto tiempo me la cambie la imagen sin refrescar toda la pagina... aunque eso ya es javascript..pero quiero que me saquen de duda....
Graciass..!!!