Posted by Rob Cornish
March 24, 2008
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!
Tags: css, div, firefox, ie6, ie7, javascript, overflow, scrolling | Comments (3)
Posted by Rob Cornish
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
Download the Css Reset stylesheet.
I always place this at the top of my stylesheet using the @import syntax.
@import "reset.css";
Tags: css, html, reset | Comments (0)
Posted by Rob Cornish
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: embed, flash, html, insert, javascript, object, transparent | Comments (0)
Posted by Rob Cornish
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: css, firefox, hacks, ie6, ie7, stylesheets | Comments (0)
Posted by Rob Cornish
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);
};
Tags: actionscript, flash, loader, pre | Comments (0)
Posted by Rob Cornish
March 14, 2008
Set the pages as:
<%
'set page id
'-------------
intPageID = 1
%>
Set the navigation menu as:
<%if intPageID = 1 then%>Home<%else%>Home<%end if%>
Tags: asp, dynamic, else, if, menu, navigation | Comments (0)
Posted by Rob Cornish
March 12, 2008
Using the asp virtual include:
<!-- #Include file = "filename.asp"-->
Tags: asp, html, include, virtual | Comments (0)