olton / m4q

Small library for DOM manipulation and animation. This library similar to jQuery, but written more simply.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FadeOut() so FadeIn()

arjarn opened this issue · comments

Not sure if it's bug or not...

If I apply FadeOut() on simple label to hide it and apply FadeIn() to show it after action, I've "display: inline-block;" ou "display:block" style on it.

So result is... surprising.

Sample (and simple) code I'm using :

  <a href="#>" target="_blank" rel="nofollow"<span class="tally alert ">bla bla bla ONE </span></a>
  <a href="#>"<span class="tally alert ">bla bla bla TWO</span></a>

With events :

$("body").on("click", ".tally", function(e){
	$(this).fadeOut();
});

$("body").on("dblclick", ".tally", function(e){
 	$(".tally").fadeIn();
});

How can I have initial page after double clicking ?

var body = $("body");

body.on("click", ".tally", function(e){
      console.log($(this).style("display")); // --> inline
      $(this).fadeOut();
});

body.on("dblclick", ".tally", function(e){
    $(".tally").fadeIn(function(){
        console.log($(this).style("display")); // --> inline
    });
});

m4q use computed value if value not defined in css or style