diff options
Diffstat (limited to 'js/abmahn.js')
-rw-r--r-- | js/abmahn.js | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/js/abmahn.js b/js/abmahn.js index 7261173..811e495 100644 --- a/js/abmahn.js +++ b/js/abmahn.js | |||
@@ -23,19 +23,19 @@ function getCheck(id) { | |||
23 | return document.getElementById(id).checked; | 23 | return document.getElementById(id).checked; |
24 | } | 24 | } |
25 | 25 | ||
26 | function scrollTo(el) { | 26 | function scrollTo(end) { |
27 | if(document.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pushState === void 0) { | 27 | if(document.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pushState === void 0) { |
28 | el.scrollIntoView(); | 28 | window.scroll(0, end); |
29 | return; | 29 | return; |
30 | } | 30 | } |
31 | var duration = 500; | 31 | var duration = 500; |
32 | var start = window.pageYOffset; | 32 | var start = window.pageYOffset; |
33 | var end = document.getElementById(el).getBoundingClientRect().top + window.pageYOffset; | 33 | // var end = document.getElementById(el).getBoundingClientRect().top + window.pageYOffset; |
34 | 34 | ||
35 | var clock = Date.now(); | 35 | var clock = Date.now(); |
36 | var requestAnimationFrame = window.requestAnimationFrame || | 36 | var requestAnimationFrame = window.requestAnimationFrame || |
37 | window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || | 37 | window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || |
38 | function(fn){window.setTimeout(fn, 15);}; | 38 | function(fn){window.setTimeout(fn, 10);}; |
39 | 39 | ||
40 | var step = function(){ | 40 | var step = function(){ |
41 | var elapsed = Date.now() - clock; | 41 | var elapsed = Date.now() - clock; |
@@ -54,14 +54,27 @@ function scrollTo(el) { | |||
54 | step(); | 54 | step(); |
55 | } | 55 | } |
56 | 56 | ||
57 | function step0_cancel() { scrollTo(0); setClass('wrapper', 'stepcancel'); } | ||
58 | function step0_done() { scrollTo(0); setClass('wrapper', 'step1'); } | ||
59 | function step1_done() { scrollTo(103); setClass('wrapper', 'step2'); } | ||
60 | function step2_done() { scrollTo(196); setClass('wrapper', 'step3'); } | ||
61 | function step3_done() { scrollTo(289); setClass('wrapper', 'step4'); } | ||
62 | function step4_done() { scrollTo(382); setClass('wrapper', 'step5'); } | ||
63 | function step5_done() { scrollTo(475); setClass('wrapper', 'step6'); } | ||
64 | function step6_done() { scrollTo(568); setClass('wrapper', 'step7'); } | ||
65 | function step7_done() { scrollTo(661); setClass('wrapper', 'step8'); } | ||
66 | |||
67 | /* | ||
57 | function step0_cancel() { setClass('wrapper', 'stepcancel'); } | 68 | function step0_cancel() { setClass('wrapper', 'stepcancel'); } |
58 | function step0_done() { setClass('wrapper', 'step1'); scrollTo('head1'); } | 69 | function step0_done() { scrollTo('head1'); setClass('wrapper', 'step1'); } |
59 | function step1_done() { setClass('wrapper', 'step2'); scrollTo('head1'); } | 70 | function step1_done() { scrollTo('head1'); setClass('wrapper', 'step2'); } |
60 | function step2_done() { setClass('wrapper', 'step3'); scrollTo('head2'); } | 71 | function step2_done() { scrollTo('head2'); setClass('wrapper', 'step3'); } |
61 | function step3_done() { setClass('wrapper', 'step4'); scrollTo('head3'); } | 72 | function step3_done() { scrollTo('head3'); setClass('wrapper', 'step4'); } |
62 | function step4_done() { setClass('wrapper', 'step5'); scrollTo('head4'); } | 73 | function step4_done() { scrollTo('head4'); setClass('wrapper', 'step5'); } |
63 | function step5_done() { setClass('wrapper', 'step6'); scrollTo('head5'); } | 74 | function step5_done() { scrollTo('head5'); setClass('wrapper', 'step6'); } |
64 | function step6_done() { setClass('wrapper', 'step7'); scrollTo('head6'); } | 75 | function step6_done() { scrollTo('head6'); setClass('wrapper', 'step7'); } |
76 | function step7_done() { scrollTo('head7'); setClass('wrapper', 'step8'); } | ||
77 | */ | ||
65 | 78 | ||
66 | function waldorf() { | 79 | function waldorf() { |
67 | setText('abmahnender_kanzlei', 'Waldorf & Frommer RAe'); | 80 | setText('abmahnender_kanzlei', 'Waldorf & Frommer RAe'); |
@@ -143,7 +156,7 @@ function ausfuellen() { | |||
143 | setText('abgemahnter_plz', '10999') | 156 | setText('abgemahnter_plz', '10999') |
144 | setText('abgemahnter_ort', 'Berlin'); | 157 | setText('abgemahnter_ort', 'Berlin'); |
145 | 158 | ||
146 | setText('abmahnender_kanzlei', 'Waldorff & Frommer'); | 159 | setText('abmahnender_kanzlei', 'Waldorf & Frommer'); |
147 | setText('abmahnender_bearbeiter', 'Horst Müller'); | 160 | setText('abmahnender_bearbeiter', 'Horst Müller'); |
148 | setText('abmahnender_strasse', 'Beethovenstraße 12'); | 161 | setText('abmahnender_strasse', 'Beethovenstraße 12'); |
149 | setText('abmahnender_plz', '80336'); | 162 | setText('abmahnender_plz', '80336'); |
@@ -317,5 +330,5 @@ function abmahnbeantworter() { | |||
317 | pdfMake.createPdf(docDefinition).download('Abmahnung-' + getText('vorgang_aktenzeichen') + '.pdf'); | 330 | pdfMake.createPdf(docDefinition).download('Abmahnung-' + getText('vorgang_aktenzeichen') + '.pdf'); |
318 | 331 | ||
319 | // advance view | 332 | // advance view |
320 | step6_done(); | 333 | step7_done(); |
321 | } | 334 | } |