Comunidad de diseño web y desarrollo en internet online

Ayuda para ejecutar hipervinculo en onload porfavor!!

Citar            
MensajeEscrito el 02 Sep 2008 10:52 pm
Hola,

lo que sucede es q me interesa lograr que esta galeria de imagenes (http://www.lokeshdhakar.com/projects/lightbox2/) inicie al cargar mi index.php;
la forma como se llama a la galeria actualmente es con <a href="images/nombreimagen.jpg" rel="lightbox[roadtrip]">imagen</a>.

porfavor, alguien me podria ayudar con la forma de "activar" el link al cargar la pagina??

porfavor... :cry:

muchas gracias de antemano comunidad

invito a una cerveza al que me ayude :beer:


^^

Por MorenoMetal

8 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 03 Sep 2008 01:58 pm
S.O.S :cry:

ayuden a este pobre nov :crap:

Por MorenoMetal

8 de clabLevel



Genero:Masculino  

chrome
Citar            
MensajeEscrito el 03 Sep 2008 03:17 pm
Primero que nada, tu avatar excede el tamaño permitido.

Lo que tu necesitas en accesar directamente a la función de javascript que inicia el proceso en lightbox. Si revisas en el código de lightbox, encontrarás que los links de las imágenes se asocian de la siguiente manera:

Código Javascript :

area.onclick = function () {myLightbox.start(this); return false;}


por lo tanto, la función que necesitas ejecutar es myLightbox.start( this ). Pero en este caso el parámetro this es ambiguo porque ya no la estas ejecutando desde el enlace, así que necesitamos cambiar un poco la declaración:

Código Javascript :

myLightbox.start( document.getElementById( 'primera_imagen' ) ); 
//o aprovechando que Lightbox utiliza la librería prototype 
myLightbox.start( $( 'primera_imagen' ); 


No olvides que el primer link de las imágenes de tu galería debe tener el id primera_imagen, sino no funcionará.

Por Odin

Claber

639 de clabLevel

2 tutoriales

Genero:Masculino   Premio_Secretos

El valle de las hamacas

firefox
Citar            
MensajeEscrito el 18 Sep 2008 08:40 pm
Muchas gracias odin ^^ , y ofrezco disculpas por lo del avatar, ya re dimensione la imagen
encuanto al lightbox.js, no encuentro en el, las sentencias que me posteo anteriormente,

a su vez encontre esto:


updateImageList: function() {
this.updateImageList = Prototype.emptyFunction;

document.observe('click', (function(event){
var target = event.findElement('a[rel^=lightbox]') || event.findElement('area[rel^=lightbox]');
if (target) {
event.stop();
this.start(target);
}
}).bind(this));
},

//
// start()
// Display overlay and lightbox. If image is part of a set, add siblings to imageArray.
//
start: function(imageLink) {

$$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'hidden' });

// stretch overlay to fill page and fade in
var arrayPageSize = this.getPageSize();
$('overlay').setStyle({ width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px' });

new Effect.Appear(this.overlay, { duration: this.overlayDuration, from: 0.0, to: LightboxOptions.overlayOpacity });

this.imageArray = [];
var imageNum = 0;

if ((imageLink.rel == 'lightbox')){
// if image is NOT part of a set, add single image to imageArray
this.imageArray.push([imageLink.href, imageLink.title]);
} else {
// if image is part of a set..
this.imageArray =
$$(imageLink.tagName + '[href][rel="' + imageLink.rel + '"]').
collect(function(anchor){ return [anchor.href, anchor.title]; }).
uniq();

while (this.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
}

// calculate top and left offset for the lightbox
var arrayPageScroll = document.viewport.getScrollOffsets();
var lightboxTop = arrayPageScroll[1] + (document.viewport.getHeight() / 10);
var lightboxLeft = arrayPageScroll[0];
this.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show();

this.changeImage(imageNum);
},


mmm evidentemente quede perdido encuanto a la parte que tengo que modificar ?? :crap:

agradeceria en el alma q me ayudaran....

Pdt: en un intento fallido intente esto <body onload="Lightbox.start()"> mm pero no funciono
me muestra:
error: object doesn't support this property or method

Por MorenoMetal

8 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 20 Sep 2008 03:23 pm
Tema cerrado ^^
ya logre el efecto que estaba buscando...
de todas formas muchas gracias comunidad.
aqui les dejo los links para que descarguen el codigo fuente con el cual logre el efecto
para quien lo pueda necesitar...
buen provecho...

....Descargar..... (y)

Por MorenoMetal

8 de clabLevel



Genero:Masculino  

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.