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 reset

    Posted by Rob CornishPostDate

    Css reset sheets are very handy! Using Dave Woods tweaked version of Eric Meyer's original reset sheet you can start fresh with better consistency between all browsers.

    I have tweaked a few things from Dave's original one. One of them is to use collapsible margins instead of padding top and bottom. It's more of a personal habbit on building sites! So for my reference i've added it in :P

    Download the Css Reset stylesheet.

    I always place this at the top of my stylesheet using the @import syntax.

    @import "reset.css";
    


  3. Inserting flash to webpage

    Posted by Rob CornishPostDate

    Using the flash.js javascript file in the head of your document.

    <script language="JavaScript" type="text/JavaScript" src="flash.js"></script>
    

    In the body of your document use:

    <script type="text/javascript">
    	FlashMovie('flashfile.swf', '500', '300');
    </script>
    

    Set the dimensions to your current flash settings, where 500 is the width and 300 is the height.



  4. 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]–>
    


  5. Flash pre-loader code

    Posted by Rob CornishPostDate

    Simple flash pre-loader actionscript 2 code

    //Pre-Loader
    myLoaded = Math.round(getBytesLoaded());
    myTotal = Math.round(getBytesTotal()); 
    
    if (myLoaded == myTotal) {
        gotoAndPlay(2);
    } else {
        gotoAndPlay(1);
    };
    


  6. Dynamic page controlling menu

    Posted by Rob CornishPostMarch 14, 2008Date

    Set the pages as:

    <%
    'set page id
    '-------------
    intPageID = 1
    %>
    

    Set the navigation menu as:

    <%if intPageID = 1 then%>Home<%else%>Home<%end if%>
    


  7. Virtual include

    Posted by Rob CornishPostMarch 12, 2008Date

    Using the asp virtual include:

    <!-- #Include file = "filename.asp"-->
    


Tags
Flickr
SelfDSC_0207DSC_0206DSC_0205
© 2008 dlnqnt - Admin - Login