+ Reply to Thread
Results 1 to 10 of 10

Thread: Entire div as link over iframe: works in FF but not IE??

  1. #1
    Barn Newbie MaxxMills84 is an unknown quantity at this point MaxxMills84's Avatar
    Join Date
    Jun 2009
    Posts
    46
    Rep Power
    3

    Entire div as link over iframe: works in FF but not IE??

    So, I'm managing a wiki and we'd like the entire mini-view calendar from our calendar app which is displayed in the side bar to act as a link to the main calendar page with the full size calendar, because if you try to actually use it with the mini-calendar in the iframe it won't be displayed correctly and everything gets cut off.

    I know this might not be strict html, but here's what I've gotten to work quite well in firefox so far:
    first i set a style sheet in the html head file that loads with every page:
    HTML Code:
    <style type="text/css">
    div.iframe-link {
    position: relative;
    float: left;
    width: 175px;
    height: 205px;
    margin: 0 1em 1em 0;
    }
    a.iframe-link {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    }
    </style> 
    then in the sidebar code, i just put a div around the mini-calendar page in an i-frame, with the style that i specified above, and a link to where i want it to go. (note: i didn't write this code myself, its adapted from something i found on another forum, but i thought i knew what it was doing)

    HTML Code:
    <table><tr><td><div class="iframe-link">
    <iframe src="mini_calendar.asp?style=sandbeach" style=" border-width:0 " width="175" height="175" frameborder="0" scrolling="no"></iframe><a href="Calendar.ashx" class="iframe-link"></a>
    </div></td></tr></table> 
    it works in firefox, but doesn't in IE 8. in firefox it does what its supposed to do and makes the entire mini_calendar.asp iframe a link that goes to calendar.ashx, in IE it only makes the background of mini_calendar.asp a link while the foreground links still make the asp page try to load other calendar asp pages in the tiny iframe

    i believe it might've worked in IE when the iframe was linking to a mini goolgle calendar instead of our own asp calendar, but i'm not 100% on that. i should go back and check though.

    maybe i should try moving around the order of the <div> and the <a> tags, i think i maybe even had them outside the table cell at one point which is why that one-cell table is in there.
    Last edited by MaxxMills84; June 26th, 2009 at 05:46 PM. Reason: remove actual links

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    I don't know if this would work or if you want to rely on a JS solution, but how about adding an onclick event to the div?
    Code:
    <div class="iframe-link" onclick="document.location.href='Calendar.ashx';"> 
    Not sure how that works when an IFRAME is embedded in the div but might be worth a go.

  3. #3
    Barn Newbie MaxxMills84 is an unknown quantity at this point MaxxMills84's Avatar
    Join Date
    Jun 2009
    Posts
    46
    Rep Power
    3

    thanks i'll give it a shot

  4. #4
    Barn Newbie MaxxMills84 is an unknown quantity at this point MaxxMills84's Avatar
    Join Date
    Jun 2009
    Posts
    46
    Rep Power
    3

    it didn't work.... same result.
    Last edited by MaxxMills84; July 1st, 2009 at 12:04 PM.

  5. #5
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    Try wrapping your <a> tags around the iframe and see if that works any better.
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

  6. #6
    Barn Newbie MaxxMills84 is an unknown quantity at this point MaxxMills84's Avatar
    Join Date
    Jun 2009
    Posts
    46
    Rep Power
    3

    nope. worse. now it doesn't work in either browser

  7. #7
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    Hey, at least it did something different. Can you change the mini_calendar.asp at all or is that a 3rd party program? Wondering if you could cause IT to redirect to the other calendar program (but that would probably break it everywhere else too).
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

  8. #8
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Quote Originally Posted by Wolffy View Post
    Hey, at least it did something different. Can you change the mini_calendar.asp at all or is that a 3rd party program? Wondering if you could cause IT to redirect to the other calendar program (but that would probably break it everywhere else too).
    I was thinking something the same, but then if it's in an IFRAME you'd have to get a reference to the parent frame to cause the redirect.

    How is the page actually constructed? Could you maybe write a seperate control or something that is used in the sidebar, rather than using an existing resource and just putting it in an IFRAME?

  9. #9
    Barn Newbie MaxxMills84 is an unknown quantity at this point MaxxMills84's Avatar
    Join Date
    Jun 2009
    Posts
    46
    Rep Power
    3

    hmm... the only thing i know is that the wiki page that's displaying the iframe is an .asp page, but the sidebar file is a static .cs file thats loaded on every page and can be edited separately.

    I do have access to edit the mini_calendar.asp or even create a new one just for the sidebar, but I'm afraid my asp isn't that good...

    I also went back and double checked the google calendar that was there before, but it also did the same thing in IE, except there was more blank space, which would act as a link, around each date so the problem wasn't as noticeable as it is now.

  10. #10
    Barn Newbie MaxxMills84 is an unknown quantity at this point MaxxMills84's Avatar
    Join Date
    Jun 2009
    Posts
    46
    Rep Power
    3

    so i tried making a copy of the mini_calendar.asp file specifically for the sidebar with the div as a link style in it's html template and it worked perfectly in firefox, but did nothing at all in internet explorer, not even made the background a link as it did before.

+ Reply to Thread

Similar Threads

  1. ODBC Link to SQL tables
    By Rebelle in forum Microsoft Access
    Replies: 2
    Last Post: May 22nd, 2009, 11:24 AM
  2. Simple code works in IE, but not Firefox
    By MichaelP in forum ASP Development
    Replies: 3
    Last Post: April 30th, 2009, 08:03 PM
  3. Link button problem
    By Chrissy in forum .NET Development
    Replies: 2
    Last Post: February 26th, 2009, 10:39 AM
  4. iFrame issues
    By marshmellow_man in forum ASP Development
    Replies: 2
    Last Post: September 30th, 2008, 10:21 AM
  5. Frame/Link issue
    By Rebelle in forum HTML & CSS Help
    Replies: 9
    Last Post: September 24th, 2008, 02:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO