Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>though collins solution worked fine, I was still searching for another way in order to use only one library in the final document. Finally I figured out a Solution which works fine with jQuery5 and UI1.8.9 and of course I'm happy to share it to anyone who has use for it:</p> <p>The HTML-Markup:</p> <pre><code>&lt;div id="gallery"&gt; &lt;div id="content"&gt;Content to slide goes here&lt;/div&gt; &lt;/div&gt; &lt;div id="scrollbar"&gt; &lt;div id="slider"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>The CSS looks like this:</p> <pre><code>.gallery { overflow: hidden; position: relative; width: 100%; padding: 0; margin: 0;} .content { position: relative; overflow: none; white-space: nowrap; padding: 0; margin: 0;} .ui-slider {position: relative; width:464px; margin-left:40px;} .ui-slider .ui-slider-handle { margin-top:2px; background-color: #999; position: absolute; width:80px; height:8px; left:0px;} .scrollBar { position: relative; background-color: #CCC; width:544px; height:12px; margin-left:53px; } .ui-slider-horizontal {} .ui-slider-horizontal .ui-slider-handle {margin-left: -40px;} .container a:active, .container a:visited, .container a:focus {top:0; left:0;} </code></pre> <p>And finally the important part, the jQuery-Stuff:</p> <pre><code>var maxScroll = 2605 - $("body").width(); var scrollable = $("#content"); $("#slider").slider({ max: maxScroll, slide: function (e, ui) { scrollable.css("left", "-" + ui.value + "px") } }); </code></pre> <p>the 2605 is the width of the #content-div. Maybe this helps anybody else... </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload