Giter VIP home page Giter VIP logo

Comments (4)

essamalsaloum avatar essamalsaloum commented on June 16, 2024 2

@olegpix

Thanks for the rapid response this is awesome! But i think good to mention that on the documentation. Thanks for the help and have a great time.

from preline.

olegpix avatar olegpix commented on June 16, 2024
		window.onload = function () {	
			const el = HSTabs.getInstance('#hs-tab-to-select-1' ,true);
			if(el) {
				el.on('change', ({ el, prev, current }) => {
					console.log('change ***********++++++', el, prev, current)
						
				});
			} else {
				console.log('el is null',el)
			}
	
		}

Problem: Encountering a null reference error when trying to use HSTabs.getInstance within window.onload. The variable el is expected to hold an instance but is consistently null, leading to issues when trying to access its properties or methods.

Hello,
Could you create an example and share it with us on Stacklblitz? We have not yet encountered such a problem during testing and use, perhaps this is a specific case.
Thank you in advance!

from preline.

essamalsaloum avatar essamalsaloum commented on June 16, 2024

Sure! Here is the link. Thank you very much!

https://stackblitz.com/edit/stackblitz-starters-bzuiv3?file=index.html

from preline.

olegpix avatar olegpix commented on June 16, 2024

Sure! Here is the link. Thank you very much!

https://stackblitz.com/edit/stackblitz-starters-bzuiv3?file=index.html

Thanks for the live link!
The problem is that you need to use a different selector, by default the plugin looks for all selectors [role="tablist"]:not(select):not(.--prevent-on-load-init), in your case, you need to use the [hs-data-tab-select="#tab-select"] selector when trying to get the instance.
You can check a working example here

from preline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.