jquery - Script being triggered too soon -
i trying replace sliders default "1, 2, 3" navigation words using jquery.
i have working code:
//changes slider numbers text navigation $(".rslides_tabs .rslides1_s1 a").text("automotive"); $(".rslides_tabs .rslides1_s2 a").text("residential"); $(".rslides_tabs .rslides1_s3 a").text("sign & millwork"); //wraps slider nav in containing div css purposes $("ul.rslides_tabs").wrap("<div class='rslides_wrap'></div>");
my problem is, half time when load page works , half time doesn't. feel it's getting called or something. have tried wrapping in both window.onload, , document.ready (and both of combined), still randomly doesn't work on page load. i've tried code above < head > tag, , right before < /body > tag, doesn't make difference.
any suggestions on can make work 100% of time?
i not sure browser using after taking @ source code did notice following:
- js building initial 1,2,3
- the automotive, residential, , sign & millwork has dedicated
.ready(){}
block - you using jquery 1.11.2 , 1.10.2 not resolving conflict
- you've placed metaslider
settimeout()
block
some suggestions code cleanup:
- definitely remove
$(window).load(function() {
- stick 1 version of jquery
tl;dr;
the cause of issue fact settimeout()
creates separate thread 1,2,3 not available targeted when code automotive, residential, , sign & millwork has been called.
Comments
Post a Comment