Note that there are some explanatory texts on larger screens.

plurals
  1. POCross browser Issue with horizontal image scrolling
    primarykey
    data
    text
    <p>Here is my <a href="http://jsfiddle.net/UPjLj" rel="nofollow">Fiddle</a>.</p> <p>I am facing issues in scrolling. I open the page in Chrome the scroll works perfectly fine,it stops when the content is finished.But in <code>firefox</code> it keeps on scrolling even if the content is finished as i have defined the fixed width to div.</p> <p>My problem is i don't know how many images will be there, as it will come from database so i can't use fixed width for scrolling.</p> <p>How can i get this fixed.</p> <p>I use mouse drag for scrolling.</p> <h1>Here is my CSS code</h1> <pre><code>#timeline { height: 375px; margin-top: 10px; padding: 20px; overflow: auto; } .tl-events { width: 11800px; list-style: none; padding: 0; margin: 0; } .tl-events li { float: left; width: 300px; margin-right: 10px; } .tl-events ul { list-style: none; margin: 0; padding: 0; } </code></pre> <h1>This is my html</h1> <pre><code>&lt;div id="timeline"&gt; &lt;ul class="tl-events"&gt; &lt;li class="welcome"&gt; &lt;h2&gt;Welcome to the interactive timeline of Google history!&lt;/h2&gt; &lt;p&gt;Travel through time by dragging the timeline or the slider below. Click on any event to see more information.&lt;/p&gt; &lt;/li&gt; &lt;li class="welcome"&gt; &lt;h2&gt;Welcome to the interactive timeline of Google history!&lt;/h2&gt; &lt;p&gt;Travel through time by dragging the timeline or the slider below. Click on any event to see more information.&lt;/p&gt; &lt;/li&gt; &lt;li class="welcome"&gt; &lt;h2&gt;Welcome to the interactive timeline of Google history!&lt;/h2&gt; &lt;p&gt;Travel through time by dragging the timeline or the slider below. Click on any event to see more information.&lt;/p&gt; &lt;/li&gt; &lt;li class="welcome"&gt; &lt;h2&gt;Welcome to the interactive timeline of Google history!&lt;/h2&gt; &lt;p&gt;Travel through time by dragging the timeline or the slider below. Click on any event to see more information.&lt;/p&gt; &lt;/li&gt; &lt;li class="welcome"&gt; &lt;h2&gt;Welcome to the interactive timeline of Google history!&lt;/h2&gt; &lt;p&gt;Travel through time by dragging the timeline or the slider below. Click on any event to see more information.&lt;/p&gt; &lt;/li&gt; &lt;li class="welcome"&gt; &lt;h2&gt;Welcome to the interactive timeline of Google history!&lt;/h2&gt; &lt;p&gt;Travel through time by dragging the timeline or the slider below. Click on any event to see more information.&lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <h1>And here is my JS</h1> <pre><code>$(document).ready(function () { $('#timeline').mousedown(function (event) { $(this) .data('down', true) .data('x', event.clientX) .data('scrollLeft', this.scrollLeft); return false; }).mouseup(function (event) { $(this).data('down', false); }).mousemove(function (event) { if ($(this).data('down') == true) { this.scrollLeft = $(this).data('scrollLeft') + $(this).data('x') - event.clientX; } }).mousewheel(function (event, delta) { this.scrollLeft -= (delta * 30); }).css({ 'overflow' : 'hidden', 'cursor' : '-moz-grab' }); }); $(window).mouseout(function (event) { if ($('#timeline').data('down')) { try { if (event.originalTarget.nodeName == 'BODY' || event.originalTarget.nodeName == 'HTML') { $('#timeline').data('down', false); } } catch (e) {} } }); </code></pre> <p>What am i doing wrong here?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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