Add scrolling effect to hidden node title Here:
http://jsfiddle.net/sdleihssirhc/AYYQe/3/

There is a nice JavaScript code to ellipsize text when it’s too long. On hover, the text  slide to the left,  and show the hidden part.
I’m struggling to make this script work in a view, to ellipsize and show hidden part from node titles.
This is my  View  structure.

&lt;div id="view"&gt;
&lt;div class="thumb"&gt;[picture]&lt;span class="thumb-overlay"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 id="tweet"&gt;[title]&lt;/h2&gt;
&lt;/div&gt;&lt;/div&gt;


this is the CSS I’m using:

#tweet, #tweet_js { border:1px solid red; width:25em; padding:.5em; }
#tweet_js { overflow:hidden; white-space:nowrap; }
.hiding { text-overflow:ellipsis; }


and this is the code:

var tweet = document.getElementById('tweet');
tweet.id = 'tweet_js';
tweet.className = 'hiding';

var slide_timer,
max = tweet.scrollWidth,
slide = function () {
    tweet.scrollLeft += 1;
    if (tweet.scrollLeft &lt; max) {
        slide_timer = setTimeout(slide, 40);
    }
    };

tweet.onmouseover = tweet.onmouseout = function (e) {
e = e || window.event;
e = e.type === 'mouseover';
clearTimeout(slide_timer);
tweet.className = e ? '' : 'hiding';
if (e) {
    slide();
} else {
    tweet.scrollLeft = 0;
}
};


I added the JavaScript file in in the module's .info file using this :

scripts[] = script.js


but nothing is working, I have tested  this JavaScript code in HTML page, and its working  only when placed before  the ending body tag.



(JavaScript and CSS are not mine, they were posted by sdleihssirhc as an answer to this question: https://stackoverflow.com/questions/4755593/css-jquery-powered-sideways-scrolling-text-on-hover )
There should be no direct errors if you got it working on a HTML page. I would suggest checking from the html source that your js file is actually loaded (if not clear the caches). Additionally try wrapping the javascript code inside

jQuery(document).ready(function() {
  //code here
});


or a possibly better option with Drupal 7:

Drupal.behaviors.exampleModule = {
  attach: function (context, settings) {
    // code here
  }
};


You might find additonal useful info about managing javaScript in Drupal 7 here.