Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

manjimaru

Path em javascript

Recommended Posts

Essa é a função original:

(function($){

 

$.randomImage = {

defaults: {

 

//you can change these defaults to your own preferences.

path: 'img/televisao/', //change this to the path of your images

myImages: ['televisao1.png', 'televisao2.png', 'televisao3.png', 'televisao4.png', 'televisao5.png', 'televisao6.png', 'televisao7.png'] //put image names in this bracket. ex: 'harold.jpg', 'maude.jpg', 'etc'

 

}

}

===================

Tentei fazer isso:

(function($){

 

$.randomImage = {

defaults: {

 

//you can change these defaults to your own preferences.

path: 'img/televisao/', //change this to the path of your images

myImages: ['televisao1.png', 'televisao2.png', 'televisao3.png', 'televisao4.png', 'televisao5.png', 'televisao6.png', 'televisao7.png']; //put image names in this bracket. ex: 'harold.jpg', 'maude.jpg', 'etc'

 

path: 'img/lugar/', //change this to the path of your images

myImages: ['lugar1.png', 'lugar2.png', 'lugar3.png', 'lugar4.png', 'lugar5.png', 'lugar6.png', 'lugar7.png']

 

}

}

 

Existe algum modo de ter vários?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Vários path's? Acho que não..

Tente colocar o path completo na imagem e deixe a variavel 'path' vazia...

 


path: '',
myImages: ['path1/lugar1.png', 'path1/lugar2.png', 'path2/lugar3.png', 'path2/lugar4.png', 'path3/lugar5.png', 'path3/lugar6.png']

Compartilhar este post


Link para o post
Compartilhar em outros sites

ok vou tentar, obrigado :thumbsup:

 

Vários path's? Acho que não..

Tente colocar o path completo na imagem e deixe a variavel 'path' vazia...

 


path: '',
myImages: ['path1/lugar1.png', 'path1/lugar2.png', 'path2/lugar3.png', 'path2/lugar4.png', 'path3/lugar5.png', 'path3/lugar6.png']

 

Infelimente não funcionou, o myImages só aceita como nome do arquivo de imagem :upset:

 

Alguma outra ideia?

 

ok vou tentar, obrigado :thumbsup:/>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.