April 16, 2012
jquery autoscroll plugin not firing
Question by preahkumpii
I am sure my issue is a result of my inexperience in jquery and javascript. I am trying to use an autoscroll jquery plugin. I just stares at me when I click the link that is supposed to activate the scroll. Can someone help? Here is what I have:
I have called the relevant scripts in the head
tag.
In at the end of my body tag I have this:
<script type="text/javascript">
$(document).ready(function() {
$("a.hello").click(function () {
$("#text").autoscroll("toggle", {
start: {
step: 50,
scroll: true,
direction: "down",
pauseOnHover: true
},
delay: 5000,
ffrw: {
speed: "fast",
step: 100
}
});
});
});
</script>
Then, I am trying to fire the script using an anchor, like this:
<a href="#" class="hello">start/stop</a>
The id of the div
that I want to ‘pause on hover’ is “text”.
The source and instructions of this plugin is found here. Thanks.
EDIT:
The function that calls some html from other files based on form selects and puts it into the <div id="text"></div>
.
function clickMe() {
var book = document.getElementById("book").value;
var chapter = document.getElementById("chapter").value;
var myFile = "'files/" + book + chapter + ".html'";
$('#text').load(myFile + '#source')
}