Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript JQuery's action go to start when I reload the page Reply To: JQuery's action go to start when I reload the page

#256053
Ayala
Participant

Thanks, meanwhile I solved it.

Here:


jQuery(function ($) { $(function() { function menuChange(ths) { var whatTab = $(ths).index(); var howFar = 120 * whatTab; //var howWidth = $(".sf-main-menu li").css('width'); if ($(".sf-main-menu li").hasClass("active-trail")) { $(".slider").css({ marginLeft: howFar + "px" //width: }); } } //$(".sf-main-menu li").click(function() { // menuChange(this); //}); menuChange($(".sf-main-menu li.active-trail")); }); });