Ir para conteúdo

POWERED BY:

Arquivado

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

cesarmachado

Carregar diferente js de acordo com a resolução para galreia responsiv

Recommended Posts

Olá pessoal, tudo bem?

 

Criei meu cadastro aqui para solicitar a ajuda de vocês, passei o dia inteiro tentando resolver um problema mas conhecimento em js é quase zero.

 

Estou alterando o layout de um site para se adaptar ao tamanho da tela do navegador ( layout responsivo ). Já consigo fazer as alterações do layout pelo css mas existe uma galeria que tem tamanho fixo inserido dentro do seu js. A única solução que pensei foi criar arquivos diferentes do js para cada tamanho da galeria que pretendo mostrar de acordo com a resolução da tela. Só que não consigo chamar o js correto para cada resolução diferente porque seria como um js dentro de outro js.

 

Precisaria alterar o jquery.galleryview-3.0-dev.js da linha abaixo:

 

 

 

<script type="text/javascript" src="http://{$url}/js/jquery.galleryview-3.0-dev.js"></script>

 

Algo como:

 

Para até 1040px:

 

 

<script type="text/javascript" src="http://{$url}/js/jquery.galleryview-3.0-dev.js"></script>

 

 

Entre 650px e 1040px:

 

 

<script type="text/javascript" src="http://{$url}/js/jquery.galleryview-3.0-dev.js"></script>

 

 

Menor que 650px:

 

 

<script type="text/javascript" src="http://{$url}/js/jquery.galleryview-3.0-dev3.js"></script>

 

Isso seria possível?

 

A função que determina a largura e altura dentro deste js é:

 

 

 

$.fn.galleryView.defaults = {


// General Options
transition_speed: 1000, //INT - duration of panel/frame transition (in milliseconds)
transition_interval: 5000, //INT - delay between panel/frame transitions (in milliseconds)
easing: 'swing', //STRING - easing method to use for animations (jQuery provides 'swing' or 'linear', more available with jQuery UI or Easing plugin)


// Panel Options
show_panels: true, //BOOLEAN - flag to show or hide panel portion of gallery
show_panel_nav: true, //BOOLEAN - flag to show or hide panel navigation buttons
enable_overlays: false, //BOOLEAN - flag to show or hide panel overlays
panel_width: 677, //INT - width of gallery panel (in pixels)
panel_height: 450, //INT - height of gallery panel (in pixels)
panel_animation: 'fade', //STRING - animation method for panel transitions (crossfade,fade,slide,none)
panel_scale: 'fit', //STRING - cropping option for panel images (crop = scale image and fit to aspect ratio determined by panel_width and panel_height, fit = scale image and preserve original aspect ratio)
overlay_position: 'bottom', //STRING - position of panel overlay (bottom, top)
pan_images: false, //BOOLEAN - flag to allow user to grab/drag oversized images within gallery
pan_style: 'drag', //STRING - panning method (drag = user clicks and drags image to pan, track = image automatically pans based on mouse position
pan_smoothness: 15, //INT - determines smoothness of tracking pan animation (higher number = smoother)


// Filmstrip Options
start_frame: 1, //INT - index of panel/frame to show first when gallery loads
show_filmstrip: true, //BOOLEAN - flag to show or hide filmstrip portion of gallery
show_filmstrip_nav: true, //BOOLEAN - flag indicating whether to display navigation buttons
enable_slideshow: true, //BOOLEAN - flag indicating whether to display slideshow play/pause button
autoplay: false, //BOOLEAN - flag to start slideshow on gallery load
show_captions: false, //BOOLEAN - flag to show or hide frame captions
filmstrip_size: 3, //INT - number of frames to show in filmstrip-only gallery
filmstrip_style: 'scroll', //STRING - type of filmstrip to use (scroll = display one line of frames, scroll filmstrip if necessary, showall = display multiple rows of frames if necessary)
filmstrip_position: 'bottom', //STRING - position of filmstrip within gallery (bottom, top, left, right)
frame_width: 80, //INT - width of filmstrip frames (in pixels)
frame_height: 60, //INT - width of filmstrip frames (in pixels)
frame_opacity: 0.4, //FLOAT - transparency of non-active frames (1.0 = opaque, 0.0 = transparent)
frame_scale: 'crop', //STRING - cropping option for filmstrip images (same as above)
frame_gap: 5, //INT - spacing between frames within filmstrip (in pixels)


// Info Bar Options
show_infobar: true, //BOOLEAN - flag to show or hide infobar
infobar_opacity: 1 //FLOAT - transparency for info bar
};

 

Aguardo ajuda de vocês, estou realmente sem saber o que fazer.
Abraço a todos.

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.