Bonjour a tous,

Voila deux heures que je cherche sans trouver de solution a mon problème...

Voici mon HTML:

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
    <dd data-magellan-arrival="Presentation" name="presentation" id="actif"><a href="#Presentation" class="scroll">Présentation</a></dd>
    <dd data-magellan-arrival="Competences" name="competence" id=""><a href="#Competences" class="scroll">Mes compétences</a></dd>
    <dd data-magellan-arrival="Formation" name="formation" id=""><a href="#Formation" class="scroll"> Ma formation</a></dd>
    <dd data-magellan-arrival="Realisations" name="realisation" id=""><a href="#Realisations" class="scroll">Mes réalisations</a></dd>
    <dd data-magellan-arrival="Contact"name="contact" id=""><a href="#Contact" class="scroll">Me contacter</a></dd>

et mon js:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//code pour detecter navigateur
navigator.sayswho = (function(){
		var N= navigator.appName, ua= navigator.userAgent, tem;
		var M= ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
		if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
		M= M? [M[1], M[2]]: [N, navigator.appVersion,'-?'];
		return M;
	})();
 
	var headerOffset = jQuery(".main-header").height(),
		blockMenu = jQuery(".block-menu"),
		nameNavigator = navigator.sayswho[0];
 
	if (nameNavigator == "Chrome") {
		var bodyelem = jQuery("body");
	}
 
	else if (nameNavigator == "Firefox") {
		var bodyelem = jQuery("body, html");
	}
 
	else if (nameNavigator == "Safari") {
		var bodyelem = jQuery(document);
	}
 
	else if (nameNavigator == "MSIE") {
		var bodyelem = jQuery(window);
	}
 
//fin code detecter navigateur
//debut code scroll
 
 var position = bodyelem.scrollTop();
    $(window).scroll(function() {
    var scroll = bodyelem.scrollTop();
 
    var actif = $('#actif').attr("name");
    if(scroll > position) {
         // scrolling downwards
         if(actif === 'presentation'){
             $('html, body').animate({scrollTop: $('#Competences').offset().top}, 1000);
             $('dd[name=presentation]').attr("id","");
             $('dd[name=competence]').attr("id","actif");
         }
         else if(actif === 'competence'){
             $('html, body').animate({scrollTop: $('#Formation').offset().top}, 1000);
             $('dd[name=competence]').attr("id","");
             $('dd[name=formation]').attr("id","actif");
         }
         else if(actif === 'formation'){
             $('html, body').animate({scrollTop: $('#Realisations').offset().top}, 1000);
             $('dd[name=formation]').attr("id","");
             $('dd[name=realisation]').attr("id","actif");
         }
         else if(actif === 'realisation'){
             $('html, body').animate({scrollTop: $('#Contact').offset().top}, 1000);
             $('dd[name=realisation]').attr("id","");
             $('dd[name=contact]').attr("id","actif");
         }
        }
    else if(scroll < position) {
         // scrolling upwards
         if(actif === 'competence'){
             $('html, body').animate({scrollTop: $('#Presentation').offset().top}, 1000);
             $('dd[name=presentation]').attr("id","actif");
             $('dd[name=competence]').attr("id","");
         }
         else if(actif === 'formation'){
             $('html, body').animate({scrollTop: $('#Competences').offset().top}, 1000);
             $('dd[name=competence]').attr("id","actif");
             $('dd[name=formation]').attr("id","");
         }
         else if(actif === 'realisation'){
             $('html, body').animate({scrollTop: $('#Formation').offset().top}, 1000);
             $('dd[name=formation]').attr("id","actif");
             $('dd[name=realisation]').attr("id","");
         }
         else if(actif === 'contact'){
             $('html, body').animate({scrollTop: $('#Realisations').offset().top}, 100);
             $('dd[name=realisation]').attr("id","actif");
             $('dd[name=contact]').attr("id","");
         }
 
    }
    position = scroll;
});
Voila mon problème:

j'essaye de faire un script permettant de naviguer sur le site juste avec le scroll, donc des qu'on "scroll down" on passe a l'ancre suivante et des qu'on "scroll up" on passe a l'ancre précédente.
bon ça fonctionne mal(je suis juste nul en js) donc en effet, le scroll ne s’arrête plus pas moyen de trouver d'ou viens le problème ni de trouver une solution....

Je fais donc appel aux pros!
Merci d'avance pour votre aide! =)