I'm trying to figure out how to go about doing this, however javascript is not my forte.
I have a facebook like button with opacity=0 set on top of an img in my html. So if someone clicks the invisible FB iframe within the image and is logged into facebook, they auto like the page of my choosing.
However I need to make this totally transparent to the user, which presents two problems:
1. The reason they click "on the image" is that they expect a new window to open when they do so. So when they click in the facebook iframe, I need my own link to open in a new window as well as the like function to process. I tried using onfocus to accomplish this, however that seemed to prevent the like from being generated, and also kept opening a new window every time I closed the new window, since closing the new window would bring the iframe back into focus.
2. If someone is not logged in to facebook, FB generates a pop-up from their iframe asking them to log in. So I either need a way to prevent their iframe from generating a pop-up, or else find a way to not display their iframe if they aren't logged in.
Any ideas how I might be able to go about doing that?
I seem to remember seeing a post about this sort of technique on here a while ago, however I cannot find it despite much searching.
I have a facebook like button with opacity=0 set on top of an img in my html. So if someone clicks the invisible FB iframe within the image and is logged into facebook, they auto like the page of my choosing.
However I need to make this totally transparent to the user, which presents two problems:
1. The reason they click "on the image" is that they expect a new window to open when they do so. So when they click in the facebook iframe, I need my own link to open in a new window as well as the like function to process. I tried using onfocus to accomplish this, however that seemed to prevent the like from being generated, and also kept opening a new window every time I closed the new window, since closing the new window would bring the iframe back into focus.
2. If someone is not logged in to facebook, FB generates a pop-up from their iframe asking them to log in. So I either need a way to prevent their iframe from generating a pop-up, or else find a way to not display their iframe if they aren't logged in.
Any ideas how I might be able to go about doing that?
I seem to remember seeing a post about this sort of technique on here a while ago, however I cannot find it despite much searching.
Last edited: