1. Lightbox blackout css javascript technique IE6

    Posted by Rob CornishPostSeptember 30, 2008Date

    A mate at work was running into problems with IE6 100% height.
    The lightbox background height would only span the height of the current window. When you scrolled down the lightbox background just ended. Alexey Kasaev found a css javascript work around for ie6.

    height:expression(eval(document.body.clientHeight) + "px");
    


  2. New IE6 PNG Fix

    Posted by Rob CornishPostAugust 26, 2008Date

    Came across an update of the IE6 PNG fix at Unit Interactive.
    This code is simple to integrate, works like a charm and very quick!
    To get started you need the unitpngfix.js.

    Add the following code into the head of your document. Change the folder structure to your desired path.

    <!--[if lt IE 7]>
            <script type="text/javascript" src="unitpngfix.js"></script>
    <![endif]-->
    

    On running this I ran into a couple of problems…
    1 - My images had the missing image graphic over the top
    2 - Links on images made some images disappear
    3 - Disappearing Divs!

    Looking into these problems I came up with a few solutions.

    1 - Missing graphic overlaying image

    For the missing images graphic over the top of my transparent image was a problem with the updated unitpngfix.js, the update stated on 08.26.08 where there was no need for the clear.gif any more didn't quite work on my IE6 browser. I changed the unitpngfix.js to have the following:

    el.src="/media/images/clear.gif";

    Instead of:

    el.src="javascript:'#define x_width 1\\n#define x_height 1\\nstatic char x_bits[]={0x00}'";

    This cleared up the missing graphic over the top of my transparent images. The clear.gif is a simple 1px x 1px blank gif sat in my images folder.
    I get the missing graphic icon on their website using IE6 too! Please fix this unit interactive!!

    2 - Disappearing images when using links

    The next issue being links on my png images, this worked on some but not others. I solved this by adding:

    img { display:block; }

    The only problem with this is that you may not want all your images to be displayed like this…

    3 - Disappearing div's

    For the disappearing div's was an odd one. My webpage was setup with a footer div that had no css styling just normal text and an image inside. The div wouldn't display! Removing the javascript displayed the div… tad confused!
    Playing with this I managed to get the div back by using:

    #selector { display:block; position:relative; height:50px; }

    The div almost acted similar to a floated object, by putting a height on this forced it to display.

    Hope all this helps :)



  3. Asp contact form with javascript validation

    Posted by Rob CornishPostMarch 24, 2008Date

    Firstly setup the html file with your form, set the name and id of this as "enquiryform". The form action needs to point to emailprocess.asp. Edit the values to suit the form.

    To validate the form, use the onsubmit syntax:

    <form onsubmit="return checkform(this);">

    This calls in the validate.js javascript file, edit the fields within the javascript to check for a value.

    Once submitted the emailprocess.asp takes all the data and sends it to the email provided in the .asp file.



  4. Random text onload using javascript

    Posted by Rob CornishPostDate

    Use the random.js javascript file in the body of your document.

    <script language="Javascript" type="text/javascript" src="random.js"></script>
    

    This will load a random line of text within the random.js file each time you visit/refresh the page.



  5. Scrolling div's and anchor links

    Posted by Rob CornishPostDate

    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!



  6. 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.



Tags
Flickr
DSC_0207DSC_0206DSC_0205DSC_0197
© 2008 dlnqnt - Admin - Login