Weakening neighbors

Tagged with:
 

52 Responses to “Weakening neighbors”

  1. Keumi says:

    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.

  2. Keumi says:

    Trouvé : span n’est pas l’ami des alt, il préfère les title…
    Ca marche. Wow.

    Encore bravo !

    • firelemure says:

      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.

  3. firelemure says:

    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

    • Rajesh says:

      It is very simple.

      First this is the structure of the images we need to add

      3,3
      3,3
      2,4
      2,4

      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();
      }

    • Rajesh says:

      It is very simple.
      First this is the structure of the images we need to add

      <div id="screen">
      <div><img title="http://mail.google.com" src="images/weakening/english/h-1.jpg" alt="3,3" /></a></div>
      <div><img title="http://www.google.com" src="images/weakening/english/h-2.jpg" alt="3,3" /></div>
      <div><img title="http://www.google.com/1" src="images/weakening/english/h-3.jpg" alt="3,3" /></div>
      <div><img title="http://www.google.com/2" src="images/weakening/english/h-4.jpg" alt="3,3" /></div>
      <div><img title="http://www.google.com/3" src="images/weakening/english/h-5.jpg" alt="3,3" /></div>
      <div><img title="http://www.google.com/4" src="images/weakening/english/v-1.jpg" alt="2,4" /></div>
      <div><img title="http://www.google.com/5" src="images/weakening/english/v-2.jpg" alt="2,4" /></div>
      <div><img title="http://www.google.com/6" src="images/weakening/english/v-3.jpg" alt="2,4" /></div>
      <div><img title="http://www.google.com/7" src="images/weakening/english/v-4.jpg" alt="2,4" /></div>
      </div>

      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();
      }

  4. Keumi says:

    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.

    • Keumi says:

      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;

      • K_Soze says:

        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

  5. Steffen says:

    I like your scripts very much. I usually worked in Flash before, but you give JavaScript a new meaning.

  6. ahsin says:

    so , it’s very good!!

  7. mwandulu says:

    Amazing job guys..Truly amazing..

  8. avona says:

    Congratulation, dear Deumeuleu,

    it´s rare, but I’m speechless;
    and impressed.

    Thank you for this excellent programm-design,

    friendly regards from Norway

    Anett

  9. Michiel Meuris says:

    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

  10. Michiel Meuris says:

    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.

    • ge1doot says:

      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:

      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:

      // ==== start script ====
      setTimeout(function() {
      	res.init();
      	res.open(0);
      }, 100);
      

      Hope this helps,

      Gerard

Leave a Reply

Feed updates subscription

Enter your email address:

Delivered by FeedBurner

Donate

Want to give me some extra encouragement ?

License

Creative Commons License

Except where otherwise noted, all Javascript code on this site is licensed under a Creative Commons License.