/** * */ $(document).ready(function() { // Use the each() method to gain access to each elements attributes $('span.'+ lightbox_style + '[rel]').each(function() { $(this).qtip( { //prerender: true, //overwrite: false, content: { text: "\"Loading...\"", title: { text: $(this).attr('title'), button: "/images/close_red.gif" }, ajax: { url: $(this).attr('rel') } }, position: { adjust: { method: "flip flip" }, at: "top right", my: "bottom left", viewport: $(window) }, show: { solo: true, event: "click", effect: function(offset) { $(this).fadeIn(200); // "this" refers to the tooltip } }, hide: { event: "unfocus" }, style: { tip: true, width: 450, classes: "ui-tooltip-light" } }) }); });