diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-03 18:06:28 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-03 18:06:28 +0000 |
commit | 965817c4be689d03573e8cc45b7b48aad574c986 (patch) | |
tree | a398d72a1f0810180d9ff882eb8a1776ccd55909 /web | |
parent | 135697bfc2ee9f5f9629a1a7b0cd70494b2d5f4f (diff) |
Get questionnaire page presentable.
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 2e5ef2594..c192db8fa 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -54,13 +54,16 @@ function heightFix(elem1, elem2, offset){ * * elem: trigger element, must have an href attribute (so probably needs to be an <a>) */ -function tabs(elem) -{ +function tabs(elem, indirect) { var href = elem.attr('href'); //stupid IE sometimes adds the full uri into the href attr, so trim var start = href.indexOf('#'), target = href.slice(start, href.length); + if (indirect) { + elem = $(target + '_tab'); + } + if(!$(target).hasClass('open')) { //toggle class on nav @@ -310,6 +313,10 @@ $(function(){ e.preventDefault(); tabs($(this)); }); + $('.tab_link').click(function(e) { + e.preventDefault(); + tabs($(this), 1); + }); /* * Skip to nav on mobile |