File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class jos {
2121 scrollProgressDisable = undefined ;
2222 disable = false ;
2323
24- static version = "0.9.2 (Development)" ;
24+ static version = "0.9.3 (Development)" ;
2525 static author = "Jesvi Jonathan" ;
2626 static webpage = "https://jos-animation.vercel.app" ;
2727 static github = "https://github.com/jesvijonathan/JOS-Animation-Library" ;
@@ -81,14 +81,12 @@ class jos {
8181 if ( target . dataset . jos_invoke != undefined ) {
8282 window [ target . dataset . jos_invoke ] ( target ) ;
8383 }
84- if (
85- target . dataset . jos_once != undefined ||
86- target . dataset . jos_once != "false"
87- ) {
88- if ( target . dataset . jos_once == "true" ) {
89- observer . unobserve ( target ) ;
90- } else if ( target . dataset . jos_counter >= target . dataset . jos_once ) {
91- observer . unobserve ( target ) ;
84+ let parentAnchors = document . querySelectorAll ( "[data-jos_anchor='#" + parentTarget . id + "']" ) ;
85+ if ( target . dataset . jos_once && ( target . dataset . jos_once == "true" || target . dataset . jos_counter >= target . dataset . jos_once ) ) {
86+ if ( parentAnchors . length < 2 ) {
87+ observer . unobserve ( parentTarget ) ;
88+ } else if ( parentAnchors . length > 1 ) {
89+ target . removeAttribute ( "data-jos_anchor" ) ;
9290 }
9391 }
9492 if ( target_jos_animationinverse != undefined ) {
You can’t perform that action at this time.
0 commit comments