Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panelslider event #24

Open
Jager001 opened this issue Jan 13, 2016 · 6 comments
Open

panelslider event #24

Jager001 opened this issue Jan 13, 2016 · 6 comments

Comments

@Jager001
Copy link

Hi! i do not know what the "psOpen" "psClose" mean , can you make explain for me, thanks

@Jager001
Copy link
Author

And i can not find it in the Source "jquery.panelslider.js"

@Nilpo
Copy link
Contributor

Nilpo commented Jan 13, 2016

Those are JavaScript events. Please refer to the Events section of README.md. For example, you can execute some code any time that the panel opens by binding to the psOpen event.

$('#my-panel').on('psOpen', function(e) {
    console.log(e.type)
});

You can find these events triggered in the source code of "jquery.panelslider.js" on lines 24, 32, 52, and 60. They look similar to this:

$panel.trigger('psOpen');

Here are two resources that may help you.

jQuery .trigger()
Triggering Event Handlers

@Jager001
Copy link
Author

thanks! but it does not work in my code, such as :

html:
this is my panel '

js:
$('#pnlMainMenu').on('psOpen', function(e) {alert(1);})

result:
the page no alert 1

@Nilpo
Copy link
Contributor

Nilpo commented Jan 13, 2016

Are you seeing any errors in the JavaScript console?

What browser are you using?

Also, please indent your code with (4) spaces on each line. This will allow you to post code without it stripping off HTML tags.

@Jager001
Copy link
Author

i find the problem,i can not find these events triggered in the source code of "jquery.panelslider.js" on lines 24, 32, 52, and 60
$panel.trigger('psOpen');

i download the source from jquery plugin official website

i will download here and try again , thanks!!

@Nilpo
Copy link
Contributor

Nilpo commented Jan 13, 2016

That should work. The code in the jQuery Plugin site is older code (v0.1.0) from before the events were added. Using the current code from the master branch should have you all fixed up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants