![]() |
Show 150 posts per page |
.dsy:it. (http://www.dsy.it/forum/)
- Tech (http://www.dsy.it/forum/forumdisplay.php?forumid=189)
-- [Info] Script random per immagini (http://www.dsy.it/forum/showthread.php?threadid=21130)
[Info] Script random per immagini
Nessuno sa dirmi come fare uno script che randomizzi delle immagini in una cartella e le visualizzi ridotte del 50% ?
__________________
Acchiappasogni
Re: [Info] Script random per immagini
Originally posted by publi
Nessuno sa dirmi come fare uno script che randomizzi delle immagini in una cartella e le visualizzi ridotte del 50% ?
se il problema è solo visualizzarle senza realmente ridurle di dimensione puoi usare un javascript tipo questo:
code:
function changeImage(){ var image1 = new Image(); image1.src = "image03.gif"; var image2 = new Image(); image2.src = "image05.gif"; var image3 = new Image(); image3.src = "image07.gif"; var image4 = new Image(); image4.src = "image09.gif"; var arrayImage = {image1, image2, image3, image4}; var ranNum= Math.round(Math.random()*4); var r = (ranNum%(arrayImage.length))+1; document.getElementById('img').src = arrayImage[r].src; setTimeout("changeImage()", 1000); }
code:
<html> <head> [omissis] </head> <body onLoad="changeImage();"> <img id="img" src="immagine.gif" width="50%"> </body> </html>
__________________
http://www.twitter.com/0m4r
<%@ Page Language="VB" ContentType="text/html" %>
<form runat="server">
<asp:Image ID="rndImg" runat="server" />
</form>
<SCRIPT language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim Randi as New Random()
rndImg.ImageUrl = Randi.Next(1, 9).ToString() & ".jpg"
End Sub
</SCRIPT>
in asp.net unico difetto e che devi chiamare i file con numeri 1.jpg 2.jpg ecc...
__________________
.:N@RV!:.
Per quanto riguarda il ridimensionamento dinamico dell'immagine, in Asp.Net ho scritto una classe che si occupa di tutto il lavoro. Se ti interessa fammi un fischio!
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
sei riuscito a trovare uno script utile per il tuo scopo?
__________________
http://www.twitter.com/0m4r
Originally posted by 0m4r
sei riuscito a trovare uno script utile per il tuo scopo?
__________________
Acchiappasogni
| All times are GMT. The time now is 09:36. | Show all 7 posts from this thread on one page |
Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.