Coder Social home page Coder Social logo

vticker's Introduction

VTicker

This project is a fork of original vTicker jQuery plugin implentation by JugBit (MIT Licensed):

http://www.jugbit.com/jquery-vticker-vertical-news-ticker/

This project uses the original code as a starting point but uses a method based implementation.

Compared to the original, it does not support fading and the direction option is removed as the animation direction is based on next or previous item: up for next; and down for previous.

Please consider supporting the original author who has a Donate button on their page.

Using

Please see the demo site for all documentation and demos:

vTicker site

More About Me

Rich Hollis

vticker's People

Contributors

juuliaans avatar richhollis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vticker's Issues

vticker has no 'destroy' or 'remove' method

I'd like to be able to remove an element from the DOM that has an instance of vticker attached to it when my view updates. If I do something like this:

render: function() {
    $('.trackinformation').vTicker({
        speed: 500,
        pause: 3000,
        direction: 'up'
    });
},
close: function() {
    $('.trackinformation').remove();
    $('.trackinformation').unbind();
 }

When the close method is called I get this type error every time the interval is called:

Uncaught TypeError: Cannot read property 'options' of undefined

Even if I call the 'stop' method that still ends up firing this error. What I would like to be able to do is to completely remove vticker from the element. Are there any plans to add this feature?

Random items

Hi,

I've been using your vticker for rss widget but I would like to make items random. Do you have any idea how to make this happend?

tnx

Ticker Displays on New Line

Hey ya,

Currently I have the code in my HTML and the ticker works fine but for some strange reason the ticker displays on the next line instead of the same line.
I've tried changing the positioning of it but that has no effect on it.

This is the current code:
<h6 class=""><b>News: </b> <div id="newsticker"> <ul> <li>New Website! <a href="blog.php?id=11">Read More...</a></li> <li>Durp! <a href="blog.php?id=11">Read More...</a></li> <li>Hurp! <a href="blog.php?id=11">Read More...</a></li> </ul> </div> </h6>

I attached a picture of how it looks.
Is there anyway of fixing such an issue?

Issue

2 instances on the same page?

Hi - when I try to use your version on two divs on the same page, only the second one scrolls. If I reverse the order in which they are declared, the one declared second again scrolls, the first is static.

I tried the original plugin and it works fine with two boxes on a page. I would prefer to use your version if I can get it working. Any help appreciated.

They are declared as

var $box1 = $("#box1");
$box1.vTicker('init', { height: 200, showItems: 4});

var $box2 = $("#box2");
$box2.vTicker('init', { height: 200, showItems: 4});

thank you

event for lazyload

Is there a way to get work with lazyload
http://www.appelsiini.net/projects/lazyload

i use event In this way
jQuery(document).ready(function () {
jQuery('#ticker-s4').vTicker({
speed: 450,
pause: 3000,
animation: 'fade',
mousePause: true,
height: 340,
showItems: 4
});
});
jQuery('#ticker-s4').on('vticker.afterTick', function() {
jQuery("img.lazy").lazyload();
});

But nothing happened

prev method only works for first item

The other issue I found is if I use the next method, the ticker operates as expected. However, if I use the prev method, the first item moves "down", but every subsequent item moves "up".

After reviewing the code, I believe I found the issue. The moveDown function passes a dir value of 'down' into animate the first time the code is run. However each time after the first, the nextUsePause function is run.

The problem is nextUsePause only calls method.next.call, and nowhere is method.prev.call called:

    nextUsePause: function() {
      var state = $(this).data('state');
      var options = state.options;
      if(state.isPaused || state.itemCount < 2) return;
      methods.next.call( this, {animate:options.animate} );  // problem code
    },

There either needs to be the addition of a separate prevUsePause function, or a conditional in nextUsePause. I was able to make this work using the conditional approach. Here are the changes I made.

1) Store "up" and "down" as state variables when in the "next" and "prev" methods:

    next: function(attribs) {
      var state = $(this).data('state');
      if(!state) return undefined;
      if(state.animating || state.itemCount < 2) return false;
      internal.restartInterval.call( this );
      state.direction = 'up';  // add this line here
      internal.moveUp(state, attribs);
    },

    prev: function(attribs) {
      var state = $(this).data('state');
      if(!state) return undefined;
      if(state.animating || state.itemCount < 2) return false;
      internal.restartInterval.call( this );
      state.direction = 'down';  // add this line here
      internal.moveDown(state, attribs);
    },

2) Remove "dir" variables passed in to moveUp and moveDown:

    moveUp: function(state, attribs) {
      internal.animate(state, attribs);  // 'up' has been removed, no longer needed
    },

    moveDown: function(state, attribs){
      internal.animate(state, attribs);  // 'down' has been removed, no longer needed
    },

3) Remove "dir" variable passed to animate, and add as a variable from state:

    animate: function(state, attribs) {  // dir has been removed
      var height = state.itemHeight;
      var options = state.options;
      var el = state.element;
      var dir = state.direction;  // added dir variable

4) Add conditional logic to nextUsePause function:

    nextUsePause: function() {
      var state = $(this).data('state');
      var options = state.options;
      if(state.isPaused || state.itemCount < 2) return;
      if(state.direction == 'up') {  // new conditional added here
        methods.next.call( this, {animate:options.animate} );
      } else {
        methods.prev.call( this, {animate:options.animate} );
      }
    },

I'd appreciate any feedback you might have. The previous option started working as expected once these updates were made.

Responsive mode

How i can integrate responsive mode. I tried with bootstrap but height of the

  • is not responsive

  • Cannot read property 'options' of undefined

    Rich, thanks for taking the time to create a fork of the original vTicker. The older version is used as an option in Drupal's Views Ticker module, and I was looking to see if we might be able to update to this version. I've caught a couple of issues, and I'll post about each.

    First, whenever trying to use the code in Drupal's interface, I get the following javascript error:

    Uncaught TypeError: Cannot read property 'options' of undefined
    jquery.vticker.js line 78

    Looks like the jQuery is running into a conflict with the Ajax code in Drupal Views used to preview query results.

    Line 78 refers to var options = state.options; within startInterval. I noticed there is an if(!state) return; line in stopInterval right after the state variable is defined. I added that line to startInterval as follows, and seems to fix the Views problem and still works as expected:

        startInterval: function() {
          var state = $(this).data('state');
          if(!state) return;  // added this line
          var options = state.options;
          var initThis = this;
          state.intervalId = setInterval(function(){
            internal.nextUsePause.call( initThis );
          }, options.pause);
        },

    Would you support making this change, or might this cause an issue elsewhere? Thanks.

    IE7 jQuery animate

    Hi man, nice plugin for jQuery.
    My name is Petar and I'm web developer from Serbia.

    I try to use this plugin yesterday and find out that is one issue with IE7.

    On line 81, function animate looks like:

    obj.animate({top: '-=' + height + 'px'}, options.speed, function() {

    this is general problem with IE7,8 because it not recognize position() function in jQuery.

    Temporary I do this to fix problem:

    height = 0 - height;
    obj.animate({top: height+"px"}, options.speed, function() {

    Let me know if you make any changes.
    Bye...

    Adding content at runtime when it reached the end

    Trying to figure it out from the code, but not sure if it was designed for it or not.

    I am trying to use it as an RSS ticker, so ideally:

    1. I would need to know when the ticker has reached its end, so I can refetch a fresh copy of the RSS feed
    2. I would need to remove all li elements, and re-add the new ones.

    Seeing this line in the init method got me worried, since if I am reading this correctly, the item count is calculated only on init.

    Is what I am trying to do feasible given the current design?

    no tags found

    bower resolve https://github.com/vikrant2mahajan/vticker.git#v1.21 bower ENORESTARGET No tag found that was able to satisfy v1.21

    but the release is fine..

    Centering Content

    This does not center the ticker on the page...how can I do that? Is something happening inside vTicker that negates any content centering?

                   <center> <div style="width:100%">
                        <div id="ticker" style="font-size:32px;margin-top:24px;display:none;width:100%">
                          <ul>
                            <li id="wxWavg">...</li>
                            <li id="wxTemp">...</li>
                            <li id="wxBaro">...</li>
                            <li id="wxDrain">...</li>
                            <li id="wxMrain">...</li>
                          </ul>
                        </div>
                    </div></center>
    

    Uncaught TypeError: $ is not a function

    First line in the new version 1.2 throws an error:

    Uncaught TypeError: $ is not a function

    Need to use standard format for first and last line:

    (function($) {
    ...
    })(jQuery);

    This fixes the problem.

    chrome console error in vticker

    hi
    today i have tried your ticker. i saw some error happened when i have used your plugin.

    here is the screenshot
    vtiker

    please check this. i am using jquery-1.11.1.min.js

    Thanks

    Uncaught TypeError: undefined is not a function

    I get this error in Chrome when I place the vTicker code block outside the document ready, Inside the doc ready the (function(c){ .... .jQuery.vTicker")}})(jQuery); works fine.

    Is this normal?

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.