Difference between revisions of "Template:UFMG Brazil/wikijs"
m (Denisoliveirac moved page Team:UFMG Brazil/wikijs to Template:UFMG Brazil/wikijs) |
|||
Line 32: | Line 32: | ||
} | } | ||
}, 50); | }, 50); | ||
+ | }); | ||
+ | |||
+ | $('.sub-text,.sub-menu,.image,.text').click(function(){ | ||
+ | var that = $(this); | ||
+ | var key = that.data('key'); | ||
+ | if (!key) | ||
+ | return; | ||
+ | if (key.length === 0 || !key.trim()) | ||
+ | return; | ||
+ | var link = links[key]; | ||
+ | if (!link) | ||
+ | return; | ||
+ | if (link.length === 0 || !link.trim()) | ||
+ | return; | ||
+ | window.location = link; | ||
}); | }); |
Revision as of 16:37, 17 September 2015
var pttr = ".image, .text, .mouth, .sub-text"; window.ref = []; var uid = 0;$('.image').each(function(){ uid++; window.ref[uid] = 0; $(this).data('uid',uid); }); $('.text, .mouth, .sub-text').each(function(){ $(this).data('uid',$(this).parent().children('.image').data('uid'));}); $(pttr).mouseenter(function(){ var uid = $(this).data('uid'); window.ref[uid] = window.ref[uid] + 1; if (window.ref[uid] == 1) { var parent = $(this).parent(); var macr = parent.children('.macr'); macr.removeClass('hide').addClass('image-macr animated fadeInUp'); parent.children('.mouth').addClass('animated fadeInDown').removeClass('hide'); parent.children('.sub-text').addClass('animated fadeIn').removeClass('hide'); } }); var setTimeoutConst; $(pttr).mouseleave(function(){ var uid = $(this).data('uid'); window.ref[uid] = window.ref[uid] - 1; var that = $(this); setTimeoutConst = setTimeout(function(){ if (window.ref[uid] == 0) { that.parent().children('.mouth').removeClass('animated fadeInDown').addClass('hide'); that.parent().children('.macr').addClass('hide').removeClass('image-macr animated fadeInUp'); that.parent().children('.sub-text').addClass('hide').removeClass('animated fadeIn') }
}, 50);
});
$('.sub-text,.sub-menu,.image,.text').click(function(){ var that = $(this); var key = that.data('key'); if (!key) return; if (key.length === 0 || !key.trim()) return; var link = links[key]; if (!link) return; if (link.length === 0 || !link.trim()) return; window.location = link; });