滚动新闻自动收报机Jquery – 问题

原始来源和示例:

http://www.htmldrive.net/items/show/397/Vertical-Scrolling-News-Ticker-With-jQuery-jCarouse

再次问好!! 滚动新闻Ticker Jquery有一些问题:


第一个问题 :Internet Explorer错误消息

“对象不支持此属性或方法”行:269:第269行)

ticker.mouseenter(function() { // <---Line: 269 //stop current animation ticker.children().stop(); }); 

  • 第二个问题 :点击新闻选项(指向页面链接)的唯一方法是通过网站示例中的蓝色文本标题。 我希望用户能够点击包含图像的选项的整个部分。

  • 第三个问题 :当新闻滚动时它看起来都是一体的,有没有办法添加一行来分隔每个部分。

  • Forth问题 :当用户将鼠标放在某个部分上时,有没有办法暂停自动滚动?
  • 有没有办法在标题和类别下添加更多文字?

这是脚本本身,IE问题突出显示在右下方的箭头

   $(function() { //cache the ticker var ticker = $("#ticker"); //wrap dt:dd pairs in divs ticker.children().filter("dt").each(function() { var dt = $(this), container = $("
"); dt.next().appendTo(container); dt.prependTo(container); container.appendTo(ticker); }); //hide the scrollbar ticker.css("overflow", "hidden"); //animator function function animator(currentItem) { //work out new anim duration var distance = currentItem.height(); duration = (distance + parseInt(currentItem.css("marginTop"))) / 0.020; //animate the first child of the ticker currentItem.animate({ marginTop: -distance }, duration, "linear", function() { //move current item to the bottom currentItem.appendTo(currentItem.parent()).css("marginTop", 0); //recurse animator(currentItem.parent().children(":first")); }); }; //start the ticker animator(ticker.children(":first")); //set mouseenter ticker.mouseenter(function() { ticker.mouseenter(function() { // <---Line: 269 //stop current animation ticker.children().stop(); }); //set mouseleave ticker.mouseleave(function() { //resume animation animator(ticker.children(":first")); }); });

我会非常感激!!

添加行分隔每个项目添加border-bottom:1px solid black; 到css。

在阅读了你的问题后,我想向你展示我在我的网站中使用的javascript方法,并在鼠标hover时停止。

 

你可以在这里查看演示