2

You know how if an image is to big, it makes the page super long/wide? And you have to scroll down with your mouse wheel and drag to the right by clicking the little bar at the bottom and dragging. Well, I need to have it where you can click and drag to scroll, as I have a map in a game that I'm creating and that would work a lot better. Here is an example of what I want:

http://scripterlative.com/files/dragscroll.htm?u=1

But the problem with that is that you have to pay for the code and I currently have a budget of $0.

Basically, I have no idea how to do this. I've looked at a bunch of other questions and stuff but none have really answered my question because they're using Jquery, Java or other coding languages, and I need to use Javascript.

Thanks in advance!

2
  • 1
    Why can't you use jquery (or another javascript library)? Commented Mar 12, 2014 at 15:32
  • I'm not allowed to--This is a project for school and I can only use JS. This function is purely cosmetic and is not required but I really would like to add it if possible. And I know it is possible, I just don't know how, which is why I asked this question.
    – Timble
    Commented Mar 12, 2014 at 15:35

1 Answer 1

4

Download dragscroll.js (https://github.com/asvd/dragscroll), link to dragscroll.js file, and use class=dragscroll in a div.

Example:

<div class=dragscroll>
    Big text goes here...
</div>
1
  • Keep in mind you can add two or more classes by just adding a space between them.
    – Josh
    Commented Mar 16, 2016 at 16:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.