This function below works in static pages but in dynamic pages it doesn't work correctly, it executes both functions when clicked the first time.
and when tested with firebug (or jsenav ) it does work correctly
$(document).ready(function() {
$(".toggleShipingSched").toggle(function(){
$(this).html("close schedule").addClass("open").parent().animate({height:300+"px"},500);
},
function(){
$(this).html("see schedule").removeClass("open").parent().animate({height:34+"px"},500);
})
});
By saying Dynamic I meant that it came from a server generated content. not static HTML And I solved the problem.