GithubHelp home page GithubHelp logo

alexandre-pod / inline-scrolling-text-overflow Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

A simple library for web to make scroll overflowing text

License: MIT License

HTML 23.08% CSS 14.73% JavaScript 62.19%

inline-scrolling-text-overflow's Introduction

inline-scrolling-text-overflow

This library provides an easy way to make text scrolling when overflowing

How to use this library

To use this lib, you have to import the library script and style in your html with:

<link rel="stylesheet" href="path/to/scrolling-text-lib.css">
<script src="path/to/scrolling-text-lib.js">

To create a scrollable overflowing text, here the steps to follow

<div>
	<span id="autoScroll">Your text here</span>
</div>
// Getting the text element that will scroll if needed
var textElement = document.querySelector('#autoScroll');

// adding the textElement to the lib, it will makes it scroll if it does not fit in its parent element
ScrollingTextLib.add(textElement);

// if you need to remove the element from the lib
ScrollingTextLib.remove(textElement);

When the window is resized, the css variables will be updated and the text will scroll if needed. If the content of the text element is changed, it is needed to recall the ScrollingTextLib.add method to update the values.

Example

A simple example is presented in the example.html file Demo

License

This project is licensed under the MIT License - see the LICENSE.md file for details

inline-scrolling-text-overflow's People

Contributors

alexandre-pod avatar

Watchers

 avatar

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.