I'm using sekFancyBox to open a modal document thus:
[[
sekfancybox?
&type=`document`
&linktext=`Comparison`
&link=`[[~56]]`
&closeClick=`true`
]]
which works fine and as expected, however in my modal document I would like to be able to click a link which closes the modal window and returns to a named anchor in the parent page.
I've tried things like:
<a href="#anchor1" target="_parent"</a>
<a href="#anchor1" onclick="fancybox.close();" </a>
<a href="#anchor1" "javascript:$.fancybox.close()" </a>
<a href="#anchor1" "javascript:void(0);" onclick="$.fancybox.close();" </a>
<a href="#anchor1" "javascript:void(0);" onclick="$.fancybox-overlay.close();" </a>
and combinations of the above etc etc and various other solutions found via google including calling the target anchor via javascript
Either the modal window will close ok but the focus does not go to the anchor
Or
the focus goes to the anchor but the modal window does not close
Can't seem to find a way to make both happen.
Seems it must be possible, but how?
Thank you for the suggestion. I tried everything on that page without any success though...
Looking near the bottom of the page, I note an answer by niccol which is interesting:
"I suspect that the answer to the original question about how to close the window from within the window has more to do with the fact that the click event is not attached to the element. If the click event is attached in document.ready the event will not be attached when fancybox creates the new window."
and he goes on to suggest a solution, however nothing I tried works for me.
It seems that it might have something to do with the sekFancyBox snippet call and more specifically the available properties?