Tuesday, 14 May 2013

How to make form placeholder text appear in Internet Explorer

One of the simplest things that HTML5 brings to web forms is the ability to set placeholder text in an input field. Placeholder text is displayed inside the input field when the page loads.   
<input type="text" placeholder="Type comments here">


When you click on the input field and start typing, the placeholder text disappears... but what about IE?


In a recent design it all looked cool (see pic) - I'd dispensed with labels for my input form and only had placeholder text. This was to save space and make it fit for mobile consumption. But then on testing in IE8 I remembered that it doesn't support placeholder text!!
Two choices, a re-design with form labels (ugly) or force IE with some JavaScript to rewrite the input field.

Obviously I'm not the first to have a problem, and the solution is already well established.
Over at www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html there is a great jQuery fix by Nico Hagenburger.  If you go to github you get a nice fork from the original that works for all eventualities (https://gist.github.com/akeemw/5114232)

All you need do is put a link to jquery at google code (in your header) like so:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>

and then stuff all the code from the github link into a new .js text file (I called mine form.js)
and then add the following at the bottom just before the closing body tag:

<script type="text/javascript" src="form.js"></script>
</body>
</html>

A neat solution - thanks Nico!!
Share/Bookmark

Monday, 13 May 2013

How to Make Internet Explorer display rounded corners CSS3

How to make IE8 & IE9 compatible with all those great CSS3 decorative features?
Yes, this is another stab at IE not looking like the other browsers.. The main bone of contention is border-radius, box-shadow & linear-gradient, something you'll find in most CSS3 buttons!

The solution is the Progressive Internet Explorer or CSS3PIE. css3pie.com




PIE is implemented as an attached behavior that you right in your CSS file.  All you need to do is download the small behaviour file and install it on your webserver.
Check out the documentation at css3pie.com

Now your site in IE can have the same look as all the other browsers!
Share/Bookmark

Sunday, 12 May 2013

Mobile Phone and iPad Emulators

This is an update on old posts regarding Mobile Phone and iPad emulators (back in 2010) for mobile web design testing.
how-to-check-your-website-for-ipad
designing-for-mobile-devices



Anyone who used Adobe's BrowserLab will know that they shut it down in March 2013 to prepare the ground for Creative Cloud and to hook everyone into the subscription software business model.

So here are the new resources:
www.mobilephoneemulator.com/
does what it says on the tin.. it emulates:
iPhone 5, 4, 3GS
Samsung Galacy S2 & Spica
Blackberry curve
HTC HD2, Touch Diamond
 LG Shine

Which is a good cross section of phone resolutions (obviously the best option is to get hold of a real phone, but this is a starting point..)

And for the ipad there is
alexw.me/ipad2/
ipadpeek.com/

And over at iphone-emulator.org
there is also an iPad Emulator, Android emulator, Blackberry and Tablet emulator..

But at the end of the day they  are all emulators and may not trick your website into thinking it's a real phone.. so why not just use:
resizemybrowser.com to resize your browser to the correct size!


Share/Bookmark

Friday, 24 August 2012

Compress PNG images better than Photoshop

This quick tip is how to compress PNG image files even smaller than photoshop and still look visually great.  An added bonus is the transparency works in IE6 (what?!! how.. that's crazy!!).

In previous posts I've talked about which image file format to use and work arounds to get IE6 to display transparency in PNG files

Over at tinypng.org you can upload up to 20 images to be processed (free) this will result in an indexed 8-bit PNG file with alpha transparency that is around 70% smaller file size.
 

Photoshop doesn't do this :( it just creates 24-bit PNGs (which are great but not as small as they can be).

Here's an example - the original png is 469KB and the tinypng is 138KB over 70% compressed can you tell the difference?

Original PNG: 469KB

Tiny PNG: 138KB (click to enlarge)


Share/Bookmark

Thursday, 23 August 2012

How to make your website cookies compliant

As you may know, there has been a recent European Union law regarding cookies and the use on websites.
This new legislation requires websites to obtain consent from visitors to store or retrieve any information on a computer or other web-connected device. This change is designed to protect online privacy by making consumers aware of how information is collected by websites (in the form of cookies) and enabling them to choose if they want this to happen.


So far there appears to be two options - the first is asking visitors to opt-in via a notice on your website.  The second is to assume consent is given by using a clearly displayed cookies notice. This second option is the one that most sites that don't require a login seem to have.

Have a look at this example www.futureplc.com/cookies-policy/ and this image from a leading European bank which is clearly visible on their website (click to zoom).

Here are some example texts that websites are using for their new cookies policy:

Cookie notice examples















For more information about cookies check out  www.allaboutcookies.org and www.aboutcookies.org

If you liked this article you may also like this one about realistic filler text and an example Privacy Policy
Share/Bookmark

Friday, 30 December 2011

How to make a scrolling image or map using jQuery


If you're trying to make a scrollable map, in a similar style to google maps where there is a fixed element with a moving image inside then jQuery is the way to go..
Here are a couple of useful resources that will get your project started:

The best option is the zoomable jQuery map plugin called Mapbox from Abel Mohler.
Not only is this scrolling, it also allows for zooming into multiple different scaled maps, so you can start with a small scale (small file) and zoom progressively into higher details maps.
Check it out here - http://wayfarerweb.com/jquery/plugins/mapbox/

Abel gives a demo with a map of middle earth as an example.
On top of this you could build your own tooltips or marker system (for example these tooltips over here http://flowplayer.org/tools/tooltip/index.html)

The second resource is CraftMap (previously MobilyMap) which is a jQuery plugin that includes overlay elements and markers -
Check it out here http://www.jscraft.net/plugins/craftmap.html


COMMENT BELOW if you know of similar resources..
Share/Bookmark

Wednesday, 14 December 2011

Free CSS font generating tool

Here's a useful tool - an online font tester that lets you test standard fonts to see what it they look like.. and then generates the CSS.
www.fonttester.com

Nice and functional - you can change all the standard font CSS properties using the user interface on the left. It's also a quick way to check out different browsers - just load fonttester in each browser and compare the fonts.
For more information on fonts and typography, take a look at the following web devil posts:


Share/Bookmark