Salut et bravo, c’est toujours autant à tomber par terre.
Y a-t-il moyen de faire la même chose en remplaçant les images par du contenu html? J’ai vite fait les modifs suivantes : changé les img en span, déclaré les span avec un display:block et de jolis fonds de couleur, changé le getElementsByTagName(img) par un getElementsByTagName(span) plus adéquat.
Et alors? Et alors, rien. Rien de rien, écran noir, tutto buio. Avec Firebug, je vois bien mes spans, tous positionnés au même endroit.
Je sens confusément qu’il me manque quelque chose, mais quoi?
et y’a moyen de ne pas mettre ça dans un title ou alt ? parce que afficher “2,3″ ou “1,3″, etc. quand on passe la souris sur l’image, ce n’est pas très beau.
great job.
I’m trying to add links to pictures when they are shown. I’m wondering whether we can add something like this.onclick = “window.location.href=’http://myurl.com’;”; somewhere in the code to change the “onclick” action previously set to “Frame.prototype.click” function.
First this is the structure of the images we need to add
means we need to add link as title.
Now search for following code
if (moves[0] == this)
moves = new Array();
replace it with following code
if (moves[0] == this){
for (var p in this) {
if(p == ‘i’){
var ci = this[p] – 1;
}
}
window.open(document.getElementById(“screen”).getElementsByTagName(“div”)[ci].getElementsByTagName(“img”)[0].title,’_blank’);
moves = new Array();
}
means we need to add link as title.
Now search for following code
if (moves[0] == this)
moves = new Array();
replace it with following code
if (moves[0] == this){
for (var p in this) {
if(p == ‘i’){
var ci = this[p] – 1;
}
}
window.open(document.getElementById(“screen”).getElementsByTagName(“div”)[ci].getElementsByTagName(“img”)[0].title,’_blank’);
moves = new Array();
}
In the Frame.prototype.click section, search :
if (o.w != 1 || o.h != 1) {
after that line, add:
if (moves[0] == this) document.location.href=this.link;
Can’t seem to add links to the expanded image through the title like you’ve shown. Could you explain a little further ? I’m not able to pass the link and have an undefined link error.
Hi,
I’ve reached page 13 by now, and i like this script the most.
After playing around with it for a few hours, i’m starting to understand most of it’s code.
I was wondering though, how i could get one image to zoom on a pageload event.
Would appreciate it a lot if some1 or you could help me with this problem.
Javascript is such a powerful language and i had no idea you could create such beauty with it.
Wow… cracking your brain for 2 days in a row… all my apologies about that
The Javascript “module pattern” I use is very powerfull. All variables and methods used in the script are “private” members and cannot be accessed from the outside.
You can create “public” resources in the return {} bloc. In your case, let’s add an “open” function :
return {
// ==== public bloc ====
init : init,
open : function (index) {
divs[index].click();
}
}
You will be able to call it from the outside (e.g. in an event bloc) like this:
res.open(0); // 0 for the first image, 1 for the next one, etc...
for example, this code will launch the script and open the first image:
Salut et bravo, c’est toujours autant à tomber par terre.
Y a-t-il moyen de faire la même chose en remplaçant les images par du contenu html? J’ai vite fait les modifs suivantes : changé les img en span, déclaré les span avec un display:block et de jolis fonds de couleur, changé le getElementsByTagName(img) par un getElementsByTagName(span) plus adéquat.
Et alors? Et alors, rien. Rien de rien, écran noir, tutto buio. Avec Firebug, je vois bien mes spans, tous positionnés au même endroit.
Je sens confusément qu’il me manque quelque chose, mais quoi?
Merci.
Trouvé : span n’est pas l’ami des alt, il préfère les title…
Ca marche. Wow.
Encore bravo !
et y’a moyen de ne pas mettre ça dans un title ou alt ? parce que afficher “2,3″ ou “1,3″, etc. quand on passe la souris sur l’image, ce n’est pas très beau.
span=div.getElementsByTagName(“span”)[0];
wh = span.title.split(“,”);
span.title = “”;
Du coup il n’apparait rien de rien au passage de la souris.
je pensais l’avoir déjà changé, mais ce n’était pas le cas.
tx
Hi !
great job.
I’m trying to add links to pictures when they are shown. I’m wondering whether we can add something like this.onclick = “window.location.href=’http://myurl.com’;”; somewhere in the code to change the “onclick” action previously set to “Frame.prototype.click” function.
Any idea ?
thank you
It is very simple.
First this is the structure of the images we need to add
means we need to add link as title.
Now search for following code
if (moves[0] == this)
moves = new Array();
replace it with following code
if (moves[0] == this){
for (var p in this) {
if(p == ‘i’){
var ci = this[p] – 1;
}
}
window.open(document.getElementById(“screen”).getElementsByTagName(“div”)[ci].getElementsByTagName(“img”)[0].title,’_blank’);
moves = new Array();
}
It is very simple.
First this is the structure of the images we need to add
means we need to add link as title.
Now search for following code
if (moves[0] == this)
moves = new Array();
replace it with following code
if (moves[0] == this){
for (var p in this) {
if(p == ‘i’){
var ci = this[p] – 1;
}
}
window.open(document.getElementById(“screen”).getElementsByTagName(“div”)[ci].getElementsByTagName(“img”)[0].title,’_blank’);
moves = new Array();
}
For Firelemure:
For each img you have, add an url in the title
src=”141042255_ebf074d1fc.jpg” alt=”3,3″ title=”http://www.dhteumeuleu.com”
In the Div constructor, search :
var wh = img.alt.split(“,”);
after that line, add :
var link = img.title;
img.title=”";
In the Frame.prototype.click section, search :
if (o.w != 1 || o.h != 1) {
after that line, add:
document.location.href=this.link;
Not very smooth, but it works.
Needs to fix it :
In the Frame.prototype.click section, search :
if (o.w != 1 || o.h != 1) {
after that line, add:
if (moves[0] == this) document.location.href=this.link;
Can’t seem to add links to the expanded image through the title like you’ve shown. Could you explain a little further ? I’m not able to pass the link and have an undefined link error.
Kind Regards
I like your scripts very much. I usually worked in Flash before, but you give JavaScript a new meaning.
so , it’s very good!!
Amazing job guys..Truly amazing..
Congratulation, dear Deumeuleu,
it´s rare, but I’m speechless;
and impressed.
Thank you for this excellent programm-design,
friendly regards from Norway
Anett
Hi,
I’ve reached page 13 by now, and i like this script the most.
After playing around with it for a few hours, i’m starting to understand most of it’s code.
I was wondering though, how i could get one image to zoom on a pageload event.
Would appreciate it a lot if some1 or you could help me with this problem.
Javascript is such a powerful language and i had no idea you could create such beauty with it.
Thanks you very much for this great site
Michiel
Could you please help me out with this ge1doot?
)
( I don’t want to beg, but this has been cracking my brains for 2 days in a row
Really like your site, can’t wait to see new stuff.
Thanks in advance.
Kind regards, Michiel.
Hi Michiel,
Wow… cracking your brain for 2 days in a row… all my apologies about that
The Javascript “module pattern” I use is very powerfull. All variables and methods used in the script are “private” members and cannot be accessed from the outside.
You can create “public” resources in the return {} bloc. In your case, let’s add an “open” function :
return { // ==== public bloc ==== init : init, open : function (index) { divs[index].click(); } }You will be able to call it from the outside (e.g. in an event bloc) like this:
for example, this code will launch the script and open the first image:
// ==== start script ==== setTimeout(function() { res.init(); res.open(0); }, 100);Hope this helps,
Gerard