target="_parent" in Fancybox is loading a new window - fancybox

Ok here's a messy one.
I've got an iframe on a page, and in that iframe I've loaded up a Fancybox iframe with a link in it that has target="_parent". My only problem is it's loading the link in a new window for some bizzare reason, not out of the fancybox and into the iframe.
My link is Continue Checkout
You can view an example of the code at https://www.dpdesignz.net/homefresh/dps/success.html. My biggest thing though is that even though this page is on my https://www.dpdesignz.net domain, the link in the button cannot be changed from the http://www.dpdesignz.co.nz to https://www.dpdesignz.net
Can anyone see what may be going wrong here?

Your link has the class="button" but there isn't in any part of your code anything that binds that selector to fancybox
something like:
$(".button").fancybox({
width : 650,
height: 400,
type : "iframe"
});
otherwise it will always open in anew window

Related

Article open in modal window after a user click on facebook share link and come back to your site

I think I need your help here... On my site, I've done all the articles open in modal window by clicking on the link "read more" that exists in every article.
Also, each article has a button that shares this article on facebook.
But, when the user who will see my article on facebook, click this link to read the article, it come back to my page, but the article (logical) not open in modal window!!!
Is there any way, in the "return" of the user on my site, after having pressed the link of facebook, automatically open this article in modal window? Or, if the question above can't be done, is there any way by customizing the link I send to facebook, to set it in the "return" of the user to my site, after having pressed the facebook's link ofcourse, to show the article in intro view and not in full view?
Thank you very much for your time!
I'm using modal windows in my website and I utilize the following HTML code to open an article in a popup:
<a class="modal" rel="{handler: 'iframe', size: {x: 680, y: 370}}" href="yourarticleid=759&tmpl=component&task=preview">Open a link in modal</a>
The method above uses the native function for creating the modal window and calls the article you need to display. However, since Facebook formats all posted links I don't think you'll be able to include the crucial piece of code (below) that triggers the modal window.
class="modal" rel="{handler: 'iframe', size: {x: 680, y: 370}}"
Here is a kind of solution, an idea in other words, that make your articles open in modal window, after a user click on facebook share link and then come back to your site.
In my case I did this...
To open modal windows in my site, I am using the extension modalizer from nonumber.nl. This extension adds something like that &ml=1 at the end of article's url. The link that comes from facebook don't contain this &ml=1 at the end. So...
1. First of all, in to my article's content, I should include modal's behavior.
2. Then, I should make my code check if the url has this &ml=1 at the end or not.
3. After, I should decide what my code will do in those two cases. So, I want to do nothing if &ml=1 already exists and I want to open facebook's url in modal window if &ml=1 doesn't exist. I also want everytime that I close my modal window to load index.php, else user will see my article on frontend view.
Here is the code for all this:
<?php JHTML::_('behavior.modal');
$url= 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
if (strstr($url, "&ml=1")){/* Do nothing */}
else {?> <a class="modal" id="modalWindowLink" href="<?php echo $url ?>"></a>
<script>
window.addEvent('domready', function(){
window.addEvent('load', function(){ SqueezeBox.fromElement($('modalWindowLink')); });
});
SqueezeBox.addEvent('onClose', function(){ window.location = 'index.php'; });
</script>
}
<?php } ?>
If you have any better idea, or if you see something that could work better in other way, please let me know!!!

Facebook like button flyout appears then disappears on a page with no other content

I have added a facebook like button to my page, however when it is clicked the flyout appears, and then disappears.
At first I thought it was other elements on the page hiding it, but the problem persisted even on blank pages.
Tried both the iframe and html 5 codes that were generated by facebook and neither seems to work.
iframe - http://jsfiddle.net/aDK95/1/
Html 5 - http://jsfiddle.net/L9nZZ/1/
In both cases it seems to been hidden by the hidden_elem class:
#facebook .hidden_elem {
display: none !important;
}
It seems very similar to this bug reported at FB that was reported in May. However there doesn't seem to be much movement on it.
Has anyone else come across this? Know of any work arounds?
I came across this bug and it flummoxed me for quite a while. The steps I took to rectify it are as follows:
Ensure that you have put in the Javascript SDK initialization
Make sure that the #fbroot div is not inside a hidden div
In the Open Graph tags on the page, the og:url has to be set to a https protocol
and not a http protocol
Run your page through the Facebook Debugger at https://developers.facebook.com/tools/debug to check for any errors. Another interesting point which helped me resolve this was that when you put in your "URL to Like" value in the Like configurator, the dynamic like button generated shows whether that url would work well or not.

facebook like button on my site only shows up after you refresh the page. does it have to do with all.js

I used code from
http://developers.facebook.com/docs/reference/plugins/like/
to add a like button on the site. I have the script tags right after the body as described and the div further down by my header, but when I load the page, the like button is not there. but if I hit refresh its there. my guess is that the all.js is taking too long to load and its missed somehow on the 1st load. on the 2nd refresh, I assume the js is cached and things work as expected.
any idea how to wait on this? I have tried putting the script in the head, at the bottom.
When you say "I have the script tags right after the body", do you mean outside of the body? If so, try putting it in side the body, but after all other element inside of the body.
<body> ...other code ...other code ...other code
<script>Put your script here</script>
</body>

Fancybox display error

Ey people
i recently designed a popup html file that's being called through fancybox inside my magento-template.
It works fine for all the pages except the homepage where it appears dislocated at the end of the page instead of appearing in the center of the window.
Firebug isnt having any errors for me and i,being a newbie, dont know where to look.
Some pointings,anyone?
Thanks
You are loading 3 instances of Fancybox :
http://www.tapet-online.ro/skin/frontend/default/acumen/js/jquery.fancybox-1.2.5.pack.js
http://www.tapet-online.ro/skin/frontend/default/acumen/fancybox/jquery.fancybox-1.3.4.pack.js
http://www.tapet-online.ro/skin/frontend/default/acumen/fancybox/jquery.fancybox-1.3.4.js
you only need a single one, may be this:
http://www.tapet-online.ro/skin/frontend/default/acumen/fancybox/jquery.fancybox-1.3.4.pack.js

How can I hide like button or div from Firefox?

I am building a web page and I have included Facebook's Like button. Works great in all browsers but not in Firefox. When clicked in Firefox, it creates an endless loop of opening and closing a facebook login window. This is a known issue that Facebook isn't looking like it will correct anytime soon.
Can anyone tell me what code I might write to hide the like button (or a div containing the like button) from Firefox only? I've never written code to detect a browser and then have my site function a certain way. Not a javascript guru here. Thanks!
You can do this using the navigator javascript object, but it sounds like you have deeper problems if the facebook like button is causing an endless loop of window loads. You most probably have other errors in your code. The button should work fine in firefox.
Here's how to text for firefox using the navigator object,
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
// user using firefox
}
This code parses the userAgent string, the string that defines the user's browser, of the navigator object. It looks for a string of the format Firefox/x.x or Firefox x.x.
This should work for you
<div id="likeDiv">
my div
</div>
<script>
if (navigator.userAgent.indexOf("Firefox")!=-1)
{
// Remove the element from the dom
var Node1 = document.getElementById('likeDiv');
Node1.removeChild(Node1.childNodes[0]);
}
</script>
Hope this helps