From 77d0e3934e1a77e941473d02f9b55685a9d57d83 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 21 Jul 2011 16:22:39 +0100 Subject: Pothole updates for Southampton. --- web/js/southampton.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 web/js/southampton.js (limited to 'web/js/southampton.js') diff --git a/web/js/southampton.js b/web/js/southampton.js new file mode 100644 index 000000000..da9552f05 --- /dev/null +++ b/web/js/southampton.js @@ -0,0 +1,35 @@ +/* + * southampton.js + * FixMyStreet JavaScript for Southampton + */ + + +$(function(){ + + $('#form_category').change(function(){ + var category = $(this).val(); + if ('Potholes' == category) { + if (!$('#potholes_extra').length) { + var qns = ''; + $('#form_title').closest('div.form-field').after(qns); + } + $('#potholes_extra').show('fast'); + } else { + $('#potholes_extra').hide('fast'); + } + }).change(); + +}); + -- cgit v1.2.3 From b2209550b140a66b7f803cfcdb971dd91080ca30 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 22 Jul 2011 17:52:07 +0100 Subject: Working placeholders for Southampton site. --- web/js/southampton.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'web/js/southampton.js') diff --git a/web/js/southampton.js b/web/js/southampton.js index da9552f05..1f3e16105 100644 --- a/web/js/southampton.js +++ b/web/js/southampton.js @@ -6,6 +6,21 @@ $(function(){ + $('[placeholder]').focus(function(){ + var input = $(this); + if (input.val() == input.attr('placeholder')) { + input.val(''); + input.removeClass('placeholder'); + input.css({ 'color': '#000000' }); + } + }).blur(function(){ + var input = $(this); + if (input.val() == '' || input.val() == input.attr('placeholder')) { + input.css({ 'color': '#999999' }); + input.val(input.attr('placeholder')); + } + }).blur(); + $('#form_category').change(function(){ var category = $(this).val(); if ('Potholes' == category) { -- cgit v1.2.3