"Scrolling Breaking News Ticker"
Bootstrap 3.3.0 Snippet by anilxkill

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="onoffswitch3"> <input type="checkbox" name="onoffswitch3" class="onoffswitch3-checkbox" id="myonoffswitch3" checked> <label class="onoffswitch3-label" for="myonoffswitch3"> <span class="onoffswitch3-inner"> <span class="onoffswitch3-active"> <marquee class="scroll-text">Avengers: Infinity War's Iron Spider Suit May Use Bleeding Edge Tech <span class="glyphicon glyphicon-forward"></span> Russo brothers ask for fans not to spoil Avengers: Infinity War <span class="glyphicon glyphicon-forward"></span> Bucky's Arm Miraculously Regenerates On Avengers: Infinity War Poster</marquee> <span class="onoffswitch3-switch">BREAKING NEWS <span class="glyphicon glyphicon-remove"></span></span> </span> <span class="onoffswitch3-inactive"><span class="onoffswitch3-switch">SHOW BREAKING NEWS</span></span> </span> </label> </div>
@import url('https://fonts.googleapis.com/css?family=Montserrat'); .onoffswitch3 { position: relative; -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; } .onoffswitch3-checkbox { display: none; } .onoffswitch3-label { display: block; overflow: hidden; cursor: pointer; border: 0px solid #999999; border-radius: 0px; } .onoffswitch3-inner { display: block; width: 200%; margin-left: -100%; -moz-transition: margin 0.3s ease-in 0s; -webkit-transition: margin 0.3s ease-in 0s; -o-transition: margin 0.3s ease-in 0s; transition: margin 0.3s ease-in 0s; } .onoffswitch3-inner > span { display: block; float: left; position: relative; width: 50%; height: 30px; padding: 0; line-height: 30px; font-size: 14px; color: white; font-family: 'Montserrat', sans-serif; font-weight: bold; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .onoffswitch3-inner .onoffswitch3-active { padding-left: 10px; background-color: #EEEEEE; color: #FFFFFF; } .onoffswitch3-inner .onoffswitch3-inactive { width: 100px; padding-left: 16px; background-color: #EEEEEE; color: #FFFFFF; text-align: right; } .onoffswitch3-switch { display: block; width: 50%; margin: 0px; text-align: center; border: 0px solid #999999;border-radius: 0px; position: absolute; top: 0; bottom: 0; } .onoffswitch3-active .onoffswitch3-switch { background: #27A1CA; left: 0; width: 160px; } .onoffswitch3-inactive{ background: #A1A1A1; right: 0; width: 20px; } .onoffswitch3-checkbox:checked + .onoffswitch3-label .onoffswitch3-inner { margin-left: 0; } .glyphicon-remove{ padding: 3px 0px 0px 0px; color: #fff; background-color: #000; height: 25px; width: 25px; border-radius: 15px; border: 2px solid #fff; } .scroll-text{ color: #000; }

Related: See More


Questions / Comments:

Add - white-space: nowrap; - to display the full message when turned off. I also changed the background colour so the words were more visible - background-color: #000000;

.onoffswitch3-inner .onoffswitch3-inactive {

width: 100px;

padding-left: 16px;

background-color: #000000;

color: #FFFFFF;

text-align: right;

white-space: nowrap;

}

Glyndwr () - 1 year ago - Reply 0


Add - white-space: nowrap; - to display the full message when turned off. I also changed the background colour so the words were more visible - background-color: #000000;

.onoffswitch3-inner .onoffswitch3-inactive {

width: 100px;

padding-left: 16px;

background-color: #000000;

color: #FFFFFF;

text-align: right;

white-space: nowrap;

}

Glyndwr () - 1 year ago - Reply 0


Thanks! Looks great! In my case, however, in my page, the ticker is collapsed on page load. How can I change it?

czechirus () - 2 years ago - Reply 0


bootstrap.min.css

bootstrap.min.js

Hi dear..

I used bootstrap code for many things in my web but sometime when I used two function in same page they will effect other or effect whole page..How to avoid that?

Please help..thank you.

MOHDMMK () - 2 years ago - Reply 0