1. Scrolling div's and anchor links

    Posted by Rob CornishPostMarch 24, 2008Date

    I've just hit a browser difference that stopped me for a while!

    My problem:

    Text links outside a scolling div to jump the scroll view to the desired location within the scrolling div.
    The scrolling div has the css overflow:auto; with a set height to enable scrolling.
    Using normal anchor links and names worked for firefox but not IE6 + IE7, after researching on the net I came across a javascript equivalent.

    document.getElementById('elmID').scrollIntoView(true);
    

    This is how I used the code, by adding this line of code into the anchor tag:

    <a href="javascript:document.getElementById('elmID').scrollIntoView(true);">
    

    Using this javascript and adding ID's to the areas I needed for scroll view worked a treat!



  2. Css hacks

    Posted by Rob CornishPostDate

    Firstly always design for firefox, for this is the best standards web browser there is!

    IE6

    * html .myClass { color:#ff0033; }
    

    IE7

    html>body .myClass { *color:#ff0033; }
    *:first-child+html #MyDiv { margin:2px; }
    

    Using seperate css stylesheets

    IE6

    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="/css/ie6.css" />
    <![endif]–>
    

    IE7

    <!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="/css/ie7.css" />
    <![endif]–>
    


Tags
Flickr
DSC_0207DSC_0206DSC_0205DSC_0197
© 2008 dlnqnt - Admin - Login