|
Forum Flash, Actionscript, PHP e MySQL
|
|
|
|
|
|
| Autore |
Messaggio |
meriokite
nuovo utente

Registrato: 17/01/11 17:10
Messaggi: 2
|
Oggetto: Consiglio su problema resize Java
Inviato: 17.01.11 | 18:39 |
|
|
ciao a tutti, sono sicuro che c'è qualcuno in grado di spiegarmi come risolvere il problema!
ho preso questo script per avere un slide di immagini sulal home page ma non capisco come eliminare il resize. io voglio dare una dimensione maggiore alle foto di base che aveva lo script (50 x 50 pixel). non voglio insomma che mi effettui il resize. come posso fare?
incollo le due parti dello script che credo interessino ( non vedo la necessità di incollarlo tutto)
grazie a chiunque mi possa aiutare ..
SCRIPT
/**
* The default options object.
* @class
* @param {string} [id] The id used as queue scope. (default: img.id)
* @param {float} [fadeInDuration] The time in seconds of the fade in. (default: 2.5)
* @param {float} [fadeOutDuration] The time in seconds of the fade out. (default: 1.5)
* @param {float} [displayDuration] The time in seconds that the image is not faded out after being faded in. (default: 2.5)
* @param {bool} [autoSize] Set true if the image should be sized to it's container. Maintains aspect ratio. (default: false)
* @param {bool} [autoStart] If false the Blender will not start until Blender#start is called. (default: true)
* @param {object} [attributes] An associative array of attributes given to the image. (default: {})
* @param {string} [dir] The directory that all images reside in. Used as a prefix for the image src. (default: null)
* @param {function} [beforeFade] A function that is called before the image is faded. 2 parameters are passed: 1. the image; 2. a boolean indicating if the image is being faded in (true) or out (false) (default: null)
* @param {int} [startIndex] The index of the first new image to be shown. (default: 0)
*/
this.options = Object.extend({
id: this.img.id,
fadeInDuration: 2.5,
fadeOutDuration: 1.5,
displayDuration: 2.5,
autoSize: false,
autoStart: true,
attributes: {},
dir: "",
beforeFade: null,
startIndex: 0
}, options || {});
E POI CONTINUA PIU SOTTO
resize: function(img) {
var dim = this.container.getDimensions(null);
dim.width -= parseInt(this.container.getStyle("padding-left")) +
parseInt(this.container.getStyle("padding-right")) +
parseInt(this.container.getStyle("border-left-width")) +
parseInt(this.container.getStyle("border-right-width"));
dim.height -= parseInt(this.container.getStyle("padding-top")) +
parseInt(this.container.getStyle("padding-bottom")) +
parseInt(this.container.getStyle("border-top-width")) +
parseInt(this.container.getStyle("border-bottom-width"));
var dw = dim.width / img.width;
var dh = dim.height / img.height;
var w1 = img.width * dh;
var h1 = img.height * dw;
if(dw > dh) {
img.width = w1;
img.height = dim.height;
} else {
img.width = dim.width;
img.height = h1;
} |
|
| Torna in cima |
|
|
Sponsor
|
|
 |
|
|
Non puoi inserire nuovi Topic in questo forum Non puoi rispondere ai Topic in questo forum Non puoi modificare i tuoi messaggi in questo forum Non puoi cancellare i tuoi messaggi in questo forum Non puoi votare nei sondaggi in questo forum Non puoi allegare files in questo forum Puoi downloadare gli allegati in questo forum
|
|