carga guión GalleryView usando jQuery provoca un problema
-
02-10-2019 - |
Pregunta
Estoy utilizando GalleryView y cuando se carga la secuencia de comandos en la cabeza como esto
<script type="text/javascript" src="/js/galleryview/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="/js/galleryview/jquery.galleryview-2.1.js"></script>
<script type="text/javascript" src="/js/galleryview/jquery.timers-1.2.js"></script>
todo funciona bien pero cuando se utiliza jQuery para cargar el como esto
$(document).ready(function(){
$('#gallery').hide();
$('<link />').appendTo('head').attr({
type: 'text/css',
rel: 'stylesheet',
href: '/js/galleryview/galleryview.css'
});
$.getScript('/js/galleryview/jquery.easing.1.3.js', function() {
$.getScript('/js/galleryview/jquery.galleryview-2.1.js', function() {
$.getScript('/js/galleryview/jquery.timers-1.2.js', function() {
$('#gallery').show();
$('#gallery').galleryView({
transition_speed: 1200,
background_color: '#006',
border: 'none',
easing: 'easeInOutBack',
pause_on_hover: true
});
});
});
});
});
consigo 404 en los botones de navegación
http: //mydoamian/undefineddark/prev.gif
http: //mydoamian/undefineddark/next.gif
cualquier ayuda sería apreciada
Solución
I fue capaz de evitar esto modificando el código en la línea 853 mediante la definición de ruta tema como una cadena vacía primero
$('script').each(function(i){
var s = $(this);
theme_path = '';
if(s.attr('src') && s.attr('src').match(/jquery\.galleryview/)){
loader_path = s.attr('src').split('jquery.galleryview')[0];
theme_path = s.attr('src').split('jquery.galleryview')[0]+'themes/';
}
A continuación, en mi llamada a GalleryView que definir adecuadamente nav_theme
$('#gallery').hide();
$('<link />').appendTo('head').attr({
rel: 'stylesheet',
type: 'text/css',
href: prefix +'js/galleryview/galleryview.css'
});
$.getScript(prefix +'js/galleryview/jquery.easing.1.3.js', function() {
$.getScript(prefix +'js/galleryview/jquery.galleryview-2.1.js', function() {
$.getScript(prefix +'js/galleryview/jquery.timers-1.2.js', function() {
$('#gallery').show();
$('#gallery').galleryView({
transition_speed: 1200,
background_color: '#006',
border: 'none',
easing: 'easeInOutBack',
nav_theme:prefix +"js/galleryview/themes/dark"
});
});
});
});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow