I am using the following code to show social icons on hover: You can see the site here: http://vitaminjdesign.com/adrian/
$('a').live('mouseover mouseout', function(event) {
if (event.type == 'mouseover') {
$('<a href="http://www.facebook.com/sharer.php?u=(this)" target="blank"><img src="images/facebook.gif" class="facebook" alt="facebook"></a>').appendTo(this).fadeIn(500);
$('<a href="#"><img src="images/twitter.gif" class="twitter" alt="twitter"></a>').appendTo(this).fadeIn(500);
} else {
$('a').find('.facebook,.twitter').stop(true, true).fadeOut(500);
}
});
The problem I am having is within the facebook URL where you see (this). I want to dynamically add in the URL of the link associated with the current a being hovered. Basically, I want to add in the URL of the element being hovered on into the (this) area of the URL. Anyone?
target="_blank"if you want each link to open in a new window and not just a new one that'll be namedblankand each subsequent link you click will open it that window instead of a new one.