0

This might be a little confusing. I'm creating this slider thing. When a slide is displayed, its onclick == "", and if it is hidden, onclick == "slide(#)" where # is the number of the slide. When you select a number to slide to, the current slide slides out, and the next slide comes in. During that, the onclick for the slide going out is suppose to == "slide(#)", and the onclick for the slide coming in is suppose to == "". My problem is reattaching the slide() to the onclick for the slide going out.

Here is my code so you can see everything that is going on: http://chigstuff.com/header/

Hopefully you can understand what I'm talking about. Thanks!

2
  • If you want to remove a click event from an element, use the unbind() function, not attr(). You getting any errors? Commented Nov 23, 2010 at 5:39
  • That is some pretty nasty code man. The best thing you could do is look through one of the jquery plugins that do this sort of thing. Here is one that is written very well. flowplayer.org/tools/tabs/index.html Commented Nov 23, 2010 at 5:40

1 Answer 1

1

I think you want to use the .click([function]) method instead of .attr() to assign the listeners.

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

1 Comment

.live('click', slide(#)) is probably a better alternative.

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.