Needing help in making jquery newsticker responsive

Needing help in making jquery newsticker responsive

Ohk here are my codes: http://codepen.io/anon/pen/aBErLR
 As you can see i already tried with :
  1. function checkPosition() {
            if (window.matchMedia('(min-width: 400px)').matches) { } else{
            $(function () {
        $(".quotes")
            .each(function () {
                len = $(this)
                    .text()
                    .length;
                if (len > 15) {
                    $(this)
                        .text($(this)
                            .text()
                            .substr(0, 15) + '...')
                }
            })
    });
        };}

but I actually wanted to make it happen automatically when the width chages and starts to shrink, then test should auto adjest and fix perfectly with the width with "..." in the last (substr+... but the amount of strings should auto decided acording to the width as to it fix fully with ...).


I hope you got it.