Created
January 12, 2013 18:28
-
-
Save pcalcao/4519777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selected_social_elem; | |
$(document).ready(function(){ | |
function closeSocialPopup(e, element_div, element_top){ | |
element_div.css("visibility","hidden"); | |
element_div.css("opacity","0"); | |
element_top.removeClass("greyedOut"); | |
} | |
$("#entrar").click(function(e){ | |
$("#login").css("visibility","visible"); | |
$(".pointyarrow").css("visibility","hidden"); | |
$("#login").css("opacity","1"); | |
$("#entrar").addClass("greyedOut"); | |
setTimeout( function() {$( "#e-mail" ).focus()}, 140 ); | |
e.stopPropagation(); | |
}); | |
$("#login").click(function(e){ | |
e.stopPropagation(); | |
}); | |
$("body").click(function(e){ | |
$("#login").css("visibility","hidden"); | |
$("#login").css("opacity","0"); | |
$("#entrar").removeClass("greyedOut"); | |
$(".pointyarrow").css("visibility","visible"); | |
}); | |
$("div.partilha").click(function(e){ | |
var curr_elem = $("div.pop-up-partilha",$(e.target).parent()); | |
if(selected_social_elem){ | |
closeSocialPopup(null, selected_social_elem, $("div.partilha")); | |
} | |
curr_elem.css("visibility","visible"); | |
curr_elem.css("opacity","1"); | |
$("div.partilha").addClass("greyedOut"); | |
e.stopPropagation(); | |
//save this element so I can disable it | |
selected_social_elem = curr_elem; | |
}); | |
$("div.pop-up-partilha").click(function(e){ | |
e.stopPropagation(); | |
}); | |
$("body").click(function(e){closeSocialPopup(e,$("div.pop-up-partilha"),$("div.partilha"))}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment