Skip to content

Instantly share code, notes, and snippets.

@tcha-tcho
Created June 21, 2013 04:37
Show Gist options
  • Save tcha-tcho/5828845 to your computer and use it in GitHub Desktop.
Save tcha-tcho/5828845 to your computer and use it in GitHub Desktop.
Solução para os títulos no Prev Next
function title_tip(next) {
var iframe = $(".fancybox-iframe").attr("src");
if (next) {
var title = $(".fancy[href='"+iframe+"']").next().find(".news_t").text();
} else {
var title = $(".fancy[href='"+iframe+"']").prev().find(".news_t").text();
};
if (title == "") title = (next?"Próxima matéria":"Matéria anterior");
return title;
}
function generate_qtip_defaults(next,event) {
qtip_defaults.show.event = event.type;
qtip_defaults.show.ready = true;
qtip_defaults.content = title_tip(next);
qtip_defaults.position.adjust.x = -15;
return qtip_defaults
}
$(".fancybox-next").live("mouseover",function(event){
$(this).qtip(generate_qtip_defaults(true,event),event);
})
$(".fancybox-prev").live("mouseover",function(event){
$(this).qtip(generate_qtip_defaults(false,event),event);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment