Hallo leute,
ich fange gerade an Javascript zu lernen und bin fleißig am scripten.
Jetz habe ich mit meinem ersten Script schon ein Problem....
Die Animation Funktioniert anfangs Problemlos, doch wenn man öfters auf die Menüpunkte Klickt wiederholt sich das ganze....
Hier das Script:
Hier der Link: A-Neubauer.de | Ihr Sachverständiger
Wenn man öfter als 1 oder 2 mal auf das selbe Klickt hängt das ganze.
Weiß jemand woran das liegt, bzw was ich hier falsch mache ?
Danke im Vorraus
ich fange gerade an Javascript zu lernen und bin fleißig am scripten.
Jetz habe ich mit meinem ersten Script schon ein Problem....
Die Animation Funktioniert anfangs Problemlos, doch wenn man öfters auf die Menüpunkte Klickt wiederholt sich das ganze....
Hier das Script:
Code:
(document).ready(function() {
var a = 0;
$("#home").click(function() {
var a = 1;
$("#content1").animate({opacity:"0", filter:"alpha(opacity=0)"}, 300, function() {
$("#content1").load("index1.html", function() {
$("#content1").animate({opacity:"0", filter:"alpha(opacity=0)", marginLeft:"100", paddingBottom:"0"}, 500);
$("#content1").animate({opacity:"1", filter:"alpha(opacity=100)", marginLeft:"0", paddingBottom:"0"}, 500);
$("#content1").stop(animate);
$("#content1").end();
});
});
});
$("#kont").click(function() {
var a = 2;
$("#content1").animate({opacity:"0", filter:"alpha(opacity=0)"}, 300, function() {
$("#content1").load("kontakt.html", function() {
$("#content1").animate({opacity:"0", filter:"alpha(opacity=0)", marginLeft:"100", paddingBottom:"0"}, 500);
$("#content1").animate({opacity:"1", filter:"alpha(opacity=100)", marginLeft:"0", paddingBottom:"0"}, 500);
$("#content1").stop(animate);
$("#content1").end();
});
});
});
$("#imp").click(function() {
var a = 3;
$("#content1").animate({opacity:"0", filter:"alpha(opacity=0)"}, 300, function() {
$("#content1").load("imptessum.html", function() {
$("#content1").animate({opacity:"0", filter:"alpha(opacity=0)", marginLeft:"100", paddingBottom:"0"}, 500);
$("#content1").animate({opacity:"1", filter:"alpha(opacity=100)", marginLeft:"0", paddingBottom:"0"}, 500);
$("#content1").stop(animate);
$("#content1").end();
});
});
});
if (a = 3) {
$("#content1").close();
$("#content1").open();
};
});
Hier der Link: A-Neubauer.de | Ihr Sachverständiger
Wenn man öfter als 1 oder 2 mal auf das selbe Klickt hängt das ganze.
Weiß jemand woran das liegt, bzw was ich hier falsch mache ?
Danke im Vorraus
Zuletzt bearbeitet von einem Moderator: