0

I'm trying to use Ariel Flesler's jquery scrollTo plugin for horizontal scrolling, but can't get the scrolling working (the plugin and jquery are included in the head). Here's the relevent HTML:

<div id="main-content">
  <div id="quiz-wrapper">

    <div class="quiz" id="question-first">
      <h5 class="quiz-question">What is the capital of X?</h5>
      <div class="quiz-answer"><a
          title="$(...).scrollTo( '#share-first', 800 );" href="#">Answer</a>
      </div>
    </div>

    <div class="quiz" id="share-first">
      <div class="points-message"> 
         <h3>+75 for every Tweet and Like</h3>
      </div>                
    </div>
  </div>
</div>

The relevant styling:

div#main-content {
  width: 570px;
}

div#quiz-wrapper {
  width: 3000px;
  overflow: hidden;
}

div.quiz {
  width: 520px;
  margin-left: 100px;
  float: left;
}

Here's the link to the plugin: http://flesler.blogspot.com/2007/10/jqueryscrollto.html. Any idea what's wrong with the scrollTo call?

vyegorov
  • 21,787
  • 7
  • 59
  • 73
Dan
  • 5
  • 2
  • 1
    Are you getting a javascript error? What exactly do you mean by 'not working'? Is `$(...)` your literal jQuery selector? I've also never seen javascript included in the `title` attribute. If you want to know that it is firing, put an alert in there instead. – veeTrain May 15 '12 at 16:04
  • Ah, stupid error... thanks for pointing out the title note - switched that to onclick and it started scrolling. – Dan May 15 '12 at 16:13

1 Answers1

0

You tried to apply javascripting into the title attribute. You probably intended to apply it to the onclick attribute.

veeTrain
  • 2,915
  • 2
  • 26
  • 43