Created
June 21, 2013 04:37
-
-
Save tcha-tcho/5828845 to your computer and use it in GitHub Desktop.
Solução para os títulos no Prev Next
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
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