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

Give active step highest data-z? #140

Open
TomRaas opened this issue Jan 23, 2014 · 3 comments
Open

Give active step highest data-z? #140

TomRaas opened this issue Jan 23, 2014 · 3 comments

Comments

@TomRaas
Copy link

TomRaas commented Jan 23, 2014

I can make a kind of script where I can appand the attribute "data-z" to the active step by checking the hash in the link. But I'm wondering if there is a function in jmpress.js for this!

Hope somebody can help!

Thanks in advance!

Greetings, tom

@sokra
Copy link
Member

sokra commented Jan 23, 2014

You can use the secondary plugin to apply an alternative configuration when the step is active.

$("#jmpress").jmpress("apply", ".step", {
  secondary: "self",
  secondaryZ: 1000
});

If you want to change the configuration with a script:

$(".step").data("stepData").z += 1000;
$("#jmpress").jmpress("reapply", ".step")

@TomRaas
Copy link
Author

TomRaas commented Jan 24, 2014

Thanks for the kwnoledge but it is not working for me yet!

I tried to get the second code working, but I get the dollowing error in jmpress.js:
TypeError: element.data is not a function ---> stepData: element.data("stepData")

The first option is only usable via template, but I dont use one. Can you tell me waht is best to do?

Gretting,

Tom

@sokra
Copy link
Member

sokra commented Jan 24, 2014

  1. The example is a template. apply applies a template (which is a javascript object, containing the values).
  2. http://api.jquery.com/data/ $("#jmpress").jmpress("reapply", $(".step"))

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