Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/05/2012, 17:52
quico5
 
Fecha de Ingreso: enero-2008
Mensajes: 580
Antigüedad: 16 años, 3 meses
Puntos: 9
jQuery HASH - Tengo un JS dentro de un HTML, al cargarlo en un TAG se pierde el JS

Tengo una galería que funciona con un plugin de jQuery, al pasarla por un HASH el JS que esta en el HTML desaparece

¿alguna solución? gracias

www.cateringasmeigas.es/jQuery/#galeria

gracias

Esta linea se pierde
Cita:
<script src="adjuntos/js/galeria.js"></script>
Cita:
function pageload(hash) {
// alert("pageload: " + hash);
// hash doesn't contain the first # character.
if(hash) {
// restore ajax loaded state
if($.browser.msie) {
// jquery's $.load() function does't work when hash include special characters like aao.
hash = encodeURIComponent(hash);
}
$('section section').load('paginas/' + hash + '.html');
} else {
// start page
$('section section').empty();
}
}

$(document).ready( function (){

// Initialize history plugin.
// The callback is called at once by present location.hash.
//$.historyInit(pageload, "paginas/demo.html");
//$('section section').load('paginas/demo.html');

// set onlick event for buttons
$("a[rel='history']").click(function(){
//
var hash = this.href;
hash = hash.replace(/^.*#/, '');
// moves to a new page.
// pageload is called at once.
// hash don't contain "#", "?"
$.historyLoad(hash);
return false;
});

jQuery.each(jQuery.browser, function(i, val) {
if(val=='8.0')
$('html').addClass('ie8');
});

if (screen.height<=700){
$('footer').css('display', 'none');
}
});
Cita:
<div id="slideshow">

<ul class="slides"> <!-- 620 320 a 600 400 -->
<li><img src="adjuntos/galeria/fotos/local2.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/local5.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/local8.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/11.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/12.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/13.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/14.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/15.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/16.jpg" width="510" height="340" alt="" /></li>
</ul>

<span class="arrow previous"></span>
<span class="arrow next"></span>
</div>

<script src="adjuntos/js/galeria.js"></script>
Cita:
<div id="slideshow">

<ul class="slides"> <!-- 620 320 a 600 400 -->
<li><img src="adjuntos/galeria/fotos/local2.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/local5.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/local8.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/11.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/12.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/13.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/14.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/15.jpg" width="510" height="340" alt="" /></li>
<li><img src="adjuntos/galeria/fotos/16.jpg" width="510" height="340" alt="" /></li>
</ul>

<span class="arrow previous"></span>
<span class="arrow next"></span>
</div>

¿Dónde ha ido el script de esta linea?

Última edición por quico5; 18/05/2012 a las 18:14