Fancybox page anchors - javascript

Is it possible to use page anchors (http://example.com/page.php#jump_to) in Fancybox and if so how?
I have tried like you normally do with a normal HTML page, where it works, but it doesn't work in Fancybox.

If you use an iframe to display the Fancybox content, then I suspect anchors will work.

Related

Direct links to the anchors do not work using jQuery Scrollto.js script

I have a site where I am using the jQuery scrollTo.js script to navigate back and forth within the main page of the site.
http://new-had.herrmanneasyeditdemo.com
The anchor links in the main nav work fine, however if you try to go to a page directly it takes you to the wrong anchor.
Click on this link: http://new-had.herrmanneasyeditdemo.com/#services
You will see that it does not take you directly to the services section. It actually takes you to the bottom of the "All in a Day’s Work" section.
Any ideas how to solve this problem?

CSS is not loading in Iframe fancy box

I have a fancybox iframe and css is written on parent page. but css is not working in Fancy box but when i change to ajax it is working properly.
If you have something in iframe you have to set the css for the page inside it too, If u want it to work. The css for the main page works just for the main page not for the iframe content.

Thickbox iFrame Showing One Div

Is there away with using Thickbox that when I use an iFrame that I can only show one particular div instead of loading the whole page?
No, this is not possible, because you can't change anything on iFrames.
You can't just hide something on other pages.

Changing content of a fancybox with ajax

I have a link in my menu that opens up a fancybox with some ajax contents. This box contains links, like a menu for the data shown in the fancybox. I would like to be able to click these links and change the content of the fancybox but all I manage is to open a new box instead, which makes the screen fade to white and back which makes it look like it's flickering.
I tried using an array of content dictionaries to just change the but couldn't get it to load any of them. I've also added a rel to the links making it a album with arrows on the side so I can go to the next/previous and that works fine except that's not the type of navigation I want. It must be possible to do the same through links instead, but I can't figure out how. Can anyone help me with this?
Edit: a small jsfiddle of some things that I tried.
Fancybox supports iframes. You could make an iframe instead. And put in another html-page there.
You can try on each link
The links located on the same server or different domains?
Have you tried with onclick="window.location.replace(url)"
I use fancybox on our web system and that helped me with fancybox

fancybox difficulties with opening an html page

Please click on the Jade on this page: http://sneakyrascal.com/starpons/gallery.html
I added a fancybox to its link and the pop-up html includes a gallery which is based on jQuery and css. I believe maybe it's because there's a jQuery in the html page it won't show correctly.
You can see in this page fancybox shows an image correctly so it should work with opening an html too. http://sneakyrascal.com/starpons/about.html
It works with Chrome but not correctly in Firefox and nothing in IE.
I will appreciate any help.
This is the way that I've opened a fancybox window with an html ajax page in the past:
Define the link with the appropriate href:
<a class="fbtag" href="/some_page.html">link</a>
Using jquery, assign the fbtag class (or whatever class) to open the fancybox & link:
$('a.fbtag').fancybox();
Fancybox will take the url that you defined in the link and use it to populate the window. You can also define any options you want in the fancybox call as well.

Categories