Solving IE6 Flicker Bug

Web Design No Comments »

In CSS, if you have ever worked with background-image rollovers, you will no doubt have found that Internet Explorer 6 tends to flicker when using “a:hover”.

After researching, the best way to combat this is to use an external javascript file in your section, like so:

<script type="text/javascript" src="/js/common.js"></script>

Then in common.js, use the following magic:

ie = document.all;
if(ie)
{
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
}

Your buttons should no longer flicker! Incidentally, IE7 has resolved this issue.

PHP Date Function

PHP, ASP No Comments »

The person that wrote the PHP Date function is a genious. I use it in almost every PHP application I write and its usage is so simple to work with. I have recently completed work on a booking calendar for www.tenerife-property-rentals.co.uk - which allows users to book any number of dates from an availability calendar. If it wasn’t for the mktime() and date(), it would have taken a long long time!

If anyone has an ASP alternative, please let me know.

Chatsworth VRML

VRML No Comments »

I thought now would be a good time to upload my Chatsworth House VRML application that I wrote in my final year at University for the module 3D Visualisation. For those that don’t know; Chatsworth House is a large country house approx 3½ miles north east of Bakewell in Derbyshire, England.

For the assignment we had to create a real-time 3D *realistic* (you’ll find out why I have put stars around that word in a minute) application using VRML (Virtual Reality Modelling Language). VRML, although it sounds cool and futuristic is actually pretty dire. That is; until they improve it - which they probably won’t therefore Universities probably shouldn’t teach it - DOH!

Limitations aside, I decided that Chatsworth House was the way to an A, so after visiting it and taking countless photos I was ready to build the app. One other thing you might notice - there is a flying pirate ship that you can jump on and view an animated tour of Chatsworth grounds (several views infact). This is a ficticious ship that you will not find when visiting Chatsworth - it was just a requirement of the assignment specification. I just didn’t want to get your hopes up.

The applications was designed for the web, hence the poor graphics (so that it loads quickly!). Polygons are also kept down low so the buildings are as basic as possible but happily this didn’t effect the grade it received (A+ - wahoo!)

Without furthur a do, you can view it here: Start the Tour!

But before you do, you may need to install a VRML player - I recommend this one: http://www.parallelgraphics.com/products/cortona

Hints:

  1. Clicking things will reveal more (a closed gate perhaps?).
  2. A-wiggley-line marks the spot.
  3. Ahoy me hearties - that be a good view

A CSS trick you probably didn’t know….

CSS No Comments »

If your like me, you will not have read a CSS book. To me, CSS is a skill you learn by example and practise. OK, I’ve read a few tutorials here and there, been amazed at how a bullet menu can be turned into a multi-level drop down, etc. etc.

So the other day I was looking at some CSS code that my fellow fish Stu had written and I noticed he had used (something similar to) the following mark-up:

<div class="red left">Hello World</div>

My first thought was “what’s he done now?” then I thought “hang on a minute, Stu’s the man. There must be a reason for this…” I then found that his CSS contained the following:

.red{ color:red; }
.left{ float:left; }

Unbelievable! I had no idea you could add two (or more) styles to a single html element. Now you know too!

PHPBB’s (lack of) Security

General No Comments »

If you own a PHPBB (www.phpbb.com), you will know how useless they are at preventing robots from signing up and posting links to spam sites.

The spamming on my board at CJ Webmaster Forums had become such a big problem, I decided to do something about it. Firstly, I updated to the latest version (2.0.21). I then installed “Anti-Spam ACP v1.1.0a” which disables the website/msn/icq/aol form fields on registration and to top it all off, I improved the CAPTCHA by installing a PHPBB “advanced” CAPTCHA that I found somewhere on Google.

The new CAPTCHA is so good, even I have trouble to figure out what the letters/numbers are:

I’d like to see them write an OCR tool to read that.

Introducing IE7

General No Comments »

So, IE7 was released on the 18th of October. Yes, I know the Beta has been out for some time now.

Naturally, the first site I browsed to was CJ Website Design only to discover the margins had messed up on all of the pages. I have fixed it now but it seems that IE7 is very strict with standards - and so it should be. The problem was, I wasn’t floating the containing element which had a margin set at 0, 5%. To fix it, I added another container for this container and floated the new container - problem solved in 2 mins. Now I am happy to report that my site looks great in all browsers; IE6, IE7, Firefox, Opera and the rest.

All in all, I’m quite impressed with IE7 - its basically Firefox with all the good things about IE6 built in and the bad things thrown out (fingers crossed - it is only day 1 of installation after all).

IE6 is really, really weird.

CSS 1 Comment »

As most CSS gimps know, IE (Internet Explorer) is a bit wacko when it comes to standards.

Take today for example, I needed to create a multi-level CSS drop down menu, which I have done many a time before, including on my own site www.cj-design.com, but with this one, the first level of navigation would not be fixed width.

The code looked something like this:

#nav ul li
{
float:left;
width:150px;
}
#nav ul ul li
{
float:left;
width:160px;
}

But as I said, I needed the first level of navigation to fit the text inside, so I did this:

#nav ul li
{
float:left;
whitespace:nowrap;
}

Firefox = Fine
Opera = Fine
IE = Arghh, what are you doing? - I need some reassurance here!

The fix for IE is as follows:

#nav ul li
{
float:left;
whitespace:nowrap;
width:1%;
}

width 1%, how stupid is that? And of course, this breaks Firefox and Opera doesn’t it. The final code ended up using the star hack to hide IE-only CSS…

#nav ul li
{
float:left;
whitespace:nowrap;
}
*html #nav ul li
{
width:1%;
}

I hope Microsoft do a good job with IE7 because this really annoyed me and it’s a waste of time trying to find a solution. Not even position:relative; or height:1%; could fix this one*. Stu agreed that this was a cool fix, therefore I blog.

*usually the following CSS can usually fix IE6 CSS bugs:

position:relative;
or
height:1%;

ASP, it’s not all bad.

ASP No Comments »

Joining Fish Media meant getting to grips with ASP at a commercial level. As some of you know, I’m not I wasn’t the greatest fan of ASP (given the other choices available; PHP/JSP). I felt ASP lacked the control, the speed, the complexity and depth of PHP. The fact it was developed by Microsoft and closed source also put me off. It seems I was wrong, in most cases.

In actual fact, ASP 3.0 isn’t all that bad. Perhaps it’s because I am a better programmer than I was 3 years ago…

My first large scale ASP project was to write a (re-usable) e-commerce web site with all sorts of advanced features. I have written it entirely in ASP, using MySQL v5.0 as a backend datasource. The best thing about the application is its built with search engine optimisation in mind - one thing that 99% of e-commerce sites fail to achieve; even Amazon - Jakob take note.

I researched quite extensively on ASP URL re-writing techniques - where PHP has its Apache mod-rewrite tricks, ASP/IIS seems to lack big time. Never fear, I came up with my own solution © CJ ASP SEO-Friendly URL 2006! Other SEO features include 1) making the site accessible to search engines (rule number 1), 2) structuring the site correctly, 3) usability, 4)…. I can’t give all my secrets away, jesus.

Technical geeks read on…ASP is such a basic language (and by language I should say VBScript); it’s when you start writing spaghetti code that it slows down. My tip of the day is to write clear, minimalistic code that gets to the point. Code that is called more than once, should be re-used and re-used effectively! Only one database and query needs to be instantiated at any one time (unless you are doing nested querying that is) - make them global to your procedures/functions and your pages will load so much quicker, I guarantee.

This is a great page that will show you how you can open/close/rewind/skip through/re-query/cancel/resync a query and much more: http://www.w3schools.com/ado/ado_ref_recordset.asp. I bet you didn’t even know you could do half of that with ADO Recordsets.


© James Crooke 2000-2008
Entries RSS Login