Adding a link to an IFRAME

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chazzy69
    New Member
    • Sep 2007
    • 196

    Adding a link to an IFRAME

    I know what your thinking what a stupid idea right??

    Well anyway what i want is an iframe which i have working so thats good; and when someone clicks on the iframe to go to the another website.

    This may sound silly but it is the only method i know of.

    The iframe is of a small page with images on it, the images update regurly and a i need to put a link onto the iframe so that it will jump to a required website.

    Something along these lines-
    Code:
    <a href="" ......><iframe ............></a>
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    I doubt if that's possibly.

    Instead you can provide onlcick="window .location='abc. htm';" to the body tag of the document inside the iframe, if you have access to it.

    Comment

    • chazzy69
      New Member
      • Sep 2007
      • 196

      #3
      Can you please show an example of this thanks

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by chazzy69
        Can you please show an example of this thanks
        I already showed how to do it.

        Ok.. there is another page which is opened inside the iFrame? In that page there must be a body tag? In that body tag, add the code which I wrote in the previous post.

        Its onclick btw.. spelling mistake :p

        Comment

        • chazzy69
          New Member
          • Sep 2007
          • 196

          #5
          Oh i understand now what your saying about having access to this other page, to answer that question no i don't have access to that page so would be unable to add that to the body tag of the other page.

          Is there not another way,

          P.s. thanks for the help so far its greatly appreciated

          Comment

          • hsriat
            Recognized Expert Top Contributor
            • Jan 2008
            • 1653

            #6
            Originally posted by chazzy69
            Oh i understand now what your saying about having access to this other page, to answer that question no i don't have access to that page so would be unable to add that to the body tag of the other page.

            Is there not another way,

            P.s. thanks for the help so far its greatly appreciated

            Ok then do something creative.
            Include that iframe in a div with position:absolu te and set its left and top accordingly.

            On top of that div, make another div and provide it same left and top along with position:absolu te. Make sure it overlaps it completely.

            onclick of that overlapping div, add the above code.

            Comment

            • chazzy69
              New Member
              • Sep 2007
              • 196

              #7
              Absolutely brillant thanks heaps

              Comment

              • hsriat
                Recognized Expert Top Contributor
                • Jan 2008
                • 1653

                #8
                You are welcome :)

                Comment

                Working...