Auto Close Google Images

5 replies
Does anyone know how to make your image automatically close when someone clicks on it on Google Images? The user that clicks on the image is then automatically taken to the website without having to exit out of the image.

And, is this against Google's TOS?
#auto #close #google #images
  • Profile picture of the author Mike Hlatky
    Anyone...?
    {{ DiscussionBoard.errors[3861791].message }}
    • Profile picture of the author RemingtonSteele
      You can't do that because you have no control over the code on Google's site, but what you can do instead is use a javascript frame buster so that services like Google/Bing/Yahoo Images can't frame your site's content.

      Here's the javascript code for busting frames:

      Code:
      if (top.frames.length!=0)
      top.location=self.document.location;
      You can put that into a .js file (just that and nothing else) and then call it the <head> area of your page like this:

      Code:
      <head>
      <script type="text/javascript" language="javascript" src="somefile.js"></script>
      </head>
      where "somefile.js" is the name of the file where you put the frame buster code. You have to put it on every page that you don't want anyone to frame.
      {{ DiscussionBoard.errors[3861856].message }}
  • Profile picture of the author BloggingPro
    I do this for all of my images sites. If your running wordpress this will do wonders for you.
    WordPress › Google Images Redirect « WordPress Plugins

    Back when GI used to toss your image up in a frame they didn't particularly care for you to "break the frame" as it was called back then and redirect to your site, but to the best of my knowledge this is not against their TOS.

    I was leery when I first added to my site, but my traffic has not once dipped.
    Signature
    You're going to fail. If you're afraid of failure then you do not belong in the Internet Marketing Business. Period.
    {{ DiscussionBoard.errors[3861921].message }}
    • Profile picture of the author Mike Hlatky
      Originally Posted by BloggingPro View Post

      I do this for all of my images sites. If your running wordpress this will do wonders for you.
      WordPress › Google Images Redirect « WordPress Plugins

      Back when GI used to toss your image up in a frame they didn't particularly care for you to "break the frame" as it was called back then and redirect to your site, but to the best of my knowledge this is not against their TOS.

      I was leery when I first added to my site, but my traffic has not once dipped.

      Awesome!

      Thanks a lot
      {{ DiscussionBoard.errors[3861936].message }}
      • Profile picture of the author RemingtonSteele
        The WP plugin does the same thing -- it inserts frame busting code into your pages. You can either use the plugin or add your own javascript to the <head> area of your site's "Main Page" (index.php) template.

        Here's what the plugin inserts into your pages:

        Code:
        <script type="text/javascript">var isInIFrame = (window.location != window.top.location) ? true : false; if (isInIFrame) window.top.location = window.location;</script>
        {{ DiscussionBoard.errors[3861956].message }}

Trending Topics