Saturday, October 27, 2012

getting the current url, replacing every dash with a slash, and jQuery animations

$(function () {
   $("#successbar").animate({ width: "302px" }, 0).animate({ width: "302px" }, 900, function
         () {
      $("#successbar").animate({ width: "302px" }, 0).animate({ width: "22px" }, 900,
            function () {
         var reroute = (document.URL).split("/")[5];
         var rerouteParts = reroute.split("-");
         reroute = '/';
         jQuery.each(rerouteParts, function () {
            reroute = reroute + this + "/";
         });
         window.location = reroute;
      });
   });
});

No comments:

Post a Comment