fancyapps/fancyBox — Issue #147: IE7 Problem with #hash links (inline content)
Author: gandazgul
Created: 2012-02-14 16:00:01+00:00
State: open

Links to #hash get rewritten in IE7 to include the whole url (e.g. for www.example.com: #this becomes www.example.com/#this). Causing jQuery to throw a syntax error when Fancybox tries to get the element. Simple fix is to clean up the href before trying to pass it to jquery:

...

// Check before try to load; 'inline' and 'html' types need content, others - href
if (type === 'inline' || type === 'html') {
href = href.replace(/.*#(.*)/, "#$1");//clean up hash href <------ This will make sure we only have the hash and nothing else

coming.content = coming.content || (type === 'inline' && href ? $(href) : element);

...