0

i made a light box and i am having a problem in a step where on click i start a function but i also want to add a class but when i use this code i wrote i am not able to add class on click and it adds its automatically when the light box loads up . here is the line of the whole code i am trying to work out

play: this.list.find(".btnPlay").click(g.play).addClass("btnPlayOn"),

using this i am able to call the function g.play but how to use addclass on click i am not able to achieve this any help on this?

1
  • you want to add clas when g.play is executed right ? Commented Jan 21, 2013 at 7:29

1 Answer 1

1

You need to add class in g.play function.. as you are using chaining... addClass will be executed immediately after click... It will not wait till your play function complete its action... so try to add addClass in play function.... hope it will work

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.