I was wondering if it is possible to scroll content by tapping and dragging it, as if with a finger on the iPhone?
Here is a jscrollpane example on jsfiddle
I was thinking about expanding the scrollbar throughout the region and making it invisible, however I would like to maintain the functionality of clicking the layer inside.
<div id="maincontainer"> <div id="MenuList" class="scroll-pane"> <div id="somelayer-one" onclick="alert('Jquery Function');">text</div> </div></div>
Is it possible? Thanks!
Additional Information
I tried to learn the source plugin and tried to change this:
function initialiseVerticalScroll() { if (isScrollableV) { container.append( $('<div class="jspVerticalBar" />').append( $('<div class="jspCap jspCapTop" />'), $('<div class="jspTrack" />').append( $('<div class="jspDrag" />').append( $('<div class="jspDragTop" />'), $('<div class="jspDragBottom" />') ) ), $('<div class="jspCap jspCapBottom" />') ) ); verticalBar = container.find('>.jspVerticalBar'); verticalTrack = verticalBar.find('>.jspTrack'); verticalDrag = verticalTrack.find('>.jspDrag'); if (settings.showArrows) { arrowUp = $('<a class="jspArrow jspArrowUp" />').bind( 'mousedown.jsp', getArrowScroll(0, -1) ).bind('click.jsp', nil); arrowDown = $('<a class="jspArrow jspArrowDown" />').bind( 'mousedown.jsp', getArrowScroll(0, 1) ).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp)); arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown)); } appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown); } verticalTrackHeight = paneHeight; container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each( function() { verticalTrackHeight -= $(this).outerHeight(); } ); verticalDrag.hover( function() { verticalDrag.addClass('jspHover'); }, function() { verticalDrag.removeClass('jspHover'); } ).bind( 'mousedown.jsp', function(e) {
I changed verticalDrag = verticalTrack.find('>.jspDrag'); on verticalDrag = verticalTrack.find('>#somelayer-one'); However, this for some reason did not work. However, I think that if it changes correctly, it might work. Any ideas?