Need to scroll the text from bottom continuously same as notice board adds as of now it is scrolling from bottom to top but the text is combined .It should work same as how notice board list scroll from bottom.Their are so many notices so it should display one by one by scrolling .
.marquee {
height: 100px;
overflow: hidden;
position: relative;
}
.marquee p {
position: absolute;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
text-align: center;
/* Starting position */
-moz-transform: translateY(100%);
-webkit-transform: translateY(100%);
transform: translateY(100%);
/* Apply animation to this element */
-moz-animation: scroll-up 5s linear infinite;
-webkit-animation: scroll-up 5s linear infinite;
animation: scroll-up 5s linear infinite;
}
/* Move it (define the animation) */
#-moz-keyframes scroll-up {
0% {
-moz-transform: translateY(100%);
}
100% {
-moz-transform: translateY(-100%);
}
}
#-webkit-keyframes scroll-up {
0% {
-webkit-transform: translateY(100%);
}
100% {
-webkit-transform: translateY(-100%);
}
}
#keyframes scroll-up {
0% {
-moz-transform: translateY(100%);
/* Browser bug fix */
-webkit-transform: translateY(100%);
/* Browser bug fix */
transform: translateY(100%);
}
100% {
-moz-transform: translateY(-100%);
/* Browser bug fix */
-webkit-transform: translateY(-100%);
/* Browser bug fix */
transform: translateY(-100%);
}
}
<div class=" marquee">
<p>Patient information management.</p>
<p>Doctor information management.</p>
<p>User management.</p>
<p>Pathology.</p>
<p>Ward management</p>
<p>Pharmacy</p>
</div>
Jsfiddle link added css here http://jsfiddle.net/f1on2ejp/3/
The p tag for each element is getting animated separately, just put them in a single p tag separated by </br>
.marquee {
height: 100px;
overflow: hidden;
position: relative;
}
.marquee p {
position: absolute;
width: 100%;
height: 100%;
text-align: center;
/* Starting position */
-moz-transform: translateY(100%);
-webkit-transform: translateY(100%);
transform: translateY(100%);
/* Apply animation to this element */
-moz-animation: scroll-up 5s linear infinite;
-webkit-animation: scroll-up 5s linear infinite;
animation: scroll-up 5s linear infinite;
}
/* Move it (define the animation) */
#keyframes scroll-up {
0% {
-moz-transform: translateY(100%);
/* Browser bug fix */
-webkit-transform: translateY(100%);
/* Browser bug fix */
transform: translateY(100%);
}
100% {
-moz-transform: translateY(-100%);
/* Browser bug fix */
-webkit-transform: translateY(-100%);
/* Browser bug fix */
transform: translateY(-100%);
}
}
<div class=" marquee">
<p>Patient information management.<br> Doctor information management.<br> User management.<br> Pathology.
<br> Ward management<br> Pharmacy
</p>
</div>
Related
I would like to add an animated message banner to a website. It works as expected on desktop and tablet view, however, when I go to a certain width in mobile view (roughly 570px), It doesn't display the full message. It takes away the last word of the sentence. The display message should say "Your reality is a matter of your perception". The word perception is being removed.
.animated-message-container {
height: 60px;
background-color:#339a9a;
border-top: 1px solid #000;
}/*Makes changes to position of the text within the purple bar underneath the contact form*/
.animated-message-text {
height: 50px;
overflow: hidden;
position: relative;
}
.animated-message-text h3 {
font-size: 27px;
color: #fff;
position: absolute;
font-family: 'DM Sans', sans-serif;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
text-align: center;
padding: 0.17%;
/* Starting position */
-moz-transform:translateX(100%);
-webkit-transform:translateX(100%);
transform:translateX(100%);
/* Apply animation to this element */
-moz-animation: example1 20s linear infinite;
-webkit-animation: example1 20s linear infinite;
animation: example1 20s linear infinite;
}
/* Move it (define the animation) */
#-moz-keyframes example1 {
0% { -moz-transform: translateX(100%); }
100% { -moz-transform: translateX(-100%); }
}
#-webkit-keyframes example1 {
0% { -webkit-transform: translateX(100%); }
100% { -webkit-transform: translateX(-100%); }
}
#keyframes example1 {
0% {
-moz-transform: translateX(100%); /* Firefox bug fix */
-webkit-transform: translateX(100%); /* Firefox bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%); /* Firefox bug fix */
-webkit-transform: translateX(-100%); /* Firefox bug fix */
transform: translateX(-100%);
}
}
<div class="animated-message-container">
<div class="animated-message-text">
<h3>"Your reality is a matter of your perception"</h3>
</div>
<!--<p>Get in touch to discuss session availability.</p>-->
</div>
Does anyone know a way to resolve this issue?
Thanks in advance.
Your h3 text is getting wrapped.
Add css
white-space : nowrap;
to prevent this. In this example, I've added it to the h3's css.
.animated-message-container {
height: 60px;
background-color:#339a9a;
border-top: 1px solid #000;
}/*Makes changes to position of the text within the purple bar underneath the contact form*/
.animated-message-text {
height: 50px;
overflow: hidden;
position: relative;
}
.animated-message-text h3 {
white-space: nowrap;
font-size: 27px;
color: #fff;
position: absolute;
font-family: 'DM Sans', sans-serif;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
text-align: center;
padding: 0.17%;
/* Starting position */
-moz-transform:translateX(100%);
-webkit-transform:translateX(100%);
transform:translateX(100%);
/* Apply animation to this element */
-moz-animation: example1 20s linear infinite;
-webkit-animation: example1 20s linear infinite;
animation: example1 20s linear infinite;
}
/* Move it (define the animation) */
#-moz-keyframes example1 {
0% { -moz-transform: translateX(100%); }
100% { -moz-transform: translateX(-100%); }
}
#-webkit-keyframes example1 {
0% { -webkit-transform: translateX(100%); }
100% { -webkit-transform: translateX(-100%); }
}
#keyframes example1 {
0% {
-moz-transform: translateX(100%); /* Firefox bug fix */
-webkit-transform: translateX(100%); /* Firefox bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%); /* Firefox bug fix */
-webkit-transform: translateX(-100%); /* Firefox bug fix */
transform: translateX(-100%);
}
}
<div class="animated-message-container">
<div class="animated-message-text">
<h3>"Your reality is a matter of your perception"</h3>
</div>
<!--<p>Get in touch to discuss session availability.</p>-->
</div>
I'm trying to write move/scroll text.
So finally I have this.
CODEPEN
There is a problem as you can see. The problem with diplay in the same time two text inside p tags. I want to display the 1st one and then should be show the 2nd one.
I was trying to change values of this
#-moz-keyframes left-one {
0% { -moz-transform: translateX(100%); }
100% { -moz-transform: translateX(-100%); }
}
#-webkit-keyframes left-one {
0% { -webkit-transform: translateX(100%); }
100% { -webkit-transform: translateX(-100%); }
}
#keyframes left-one {
0% {
-moz-transform: translateX(100%); /* Firefox bug fix */
-webkit-transform: translateX(100%); /* Firefox bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%); /* Firefox bug fix */
-webkit-transform: translateX(-100%); /* Firefox bug fix */
transform: translateX(-100%);
}
}
I mean 0% to 50% but it's not good.
How I can solve it?
The whole picture of the animation you want to show is 30s long, not 15s. Each individual animation is 15s on the screen, but the whole animation is 30s if you account for the time of the first animation + the time of the second animation, so they don't overlap.
So change the animation time of both to 30s, and do the first animation in the first 15s (0-50%), and do the second animation in the last 15s (50-100%)
.movetext {
width: 100%;
height: 50px;
overflow: hidden;
position: relative;
background-color: black;
}
.movetext p {
position: absolute;
font-family: Verdana, Arial;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
text-align: center;
color: yellow;
font-weight: bold;
font-size: 20px;
transform: translateX(100%);
}
.movetext p:nth-child(1) {
animation: left-one 30s linear infinite;
}
.movetext p:nth-child(2) {
animation: left-two 30s linear infinite;
}
#keyframes left-one {
0% {
transform: translateX(100%);
}
50% {
transform: translateX(-100%);
}
100% {
transform: translateX(-100%);
}
}
#keyframes left-two {
50% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
<div class="container">
<div class="movetext">
<p>Something is here.</p>
<p>But maybe something will be here.</P>
</div>
</div>
Thanks man. It's working very well. :)
I saw there is a little problem on mobile view. The all text is not display properly. It's just cut off. For the other resolutions (>768) everything is good.
So how about this. How I can handle it?
EDIT
I saw the problem. P tag set width of class. I know I can set witdh eg. 700px but I would like to p tag set width of width text.
I'm trying to have a scrolling marquee of sorts across the top of my webpage. I'm not using the tag as it is not supported by Safari. However, even with using CSS Animation, it doesn't seem to work for Safari either. Here's my code:
<h3>Upcoming Shows:...</h3>
This is what I have in my style sheet:
h3 {
position: absolute;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
text-align: center;
/* Starting position */
-moz-transform:translateX(100%);
-webkit-transform:translateX(100%);
transform:translateX(100%);
/* Apply animation to this element */
-moz-animation: example1 15s linear infinite;
-webkit-animation: example1 15s linear infinite;
animation: example1 15s linear infinite;
}
/* Move it (define the animation) */
#-moz-keyframes example1 {
0% { -moz-transform: translateX(100%); }
100% { -moz-transform: translateX(-100%); }
}
#-webkit-keyframes example1 {
0% { -webkit-transform: translateX(100%); }
100% { -webkit-transform: translateX(-100%); }
}
#keyframes example1 {
0% {
-moz-transform: translateX(100%); /* Firefox bug fix */
-webkit-transform: translateX(100%); /* Firefox bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%); /* Firefox bug fix */
-webkit-transform: translateX(-100%); /* Firefox bug fix */
transform: translateX(-100%);
}
}
I want to scroll the text, word by word, left to right. Just like this page, the word scrolling word by word until the last word. Then it will start again once the last word is hidden.
I am not use <marquee> for iOS because the scrolling text seems like not scrolling smooth like in Android. So, I did some changes in my code.
The result is the scrolling text was not hidden word by word until the last word. The last word not finish scrolling but suddenly it dissapear in a half way. Then it start srcolling again.
try this css code
body {
cursor: url('http://ionicframework.com/img/finger.png'), auto;
}
.scroll-left {
height: 50px;
position: relative;
overflow: hidden;
}
.scroll-left p {
white-space: nowrap !important;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
/* Apply animation to this element */
-moz-animation: scroll-left 20s linear infinite;
-webkit-animation: scroll-left 20s linear infinite;
animation: scroll-left 20s linear infinite;
}
#-moz-keyframes scroll-left {
0% {
-moz-transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%);
}
}
#-webkit-keyframes scroll-left {
0% {
-webkit-transform: translateX(100%);
}
100% {
-webkit-transform: translateX(-100%);
}
}
#keyframes scroll-left {
0% {
-moz-transform: translateX(100%);
/* Browser bug fix */
-webkit-transform: translateX(100%);
/* Browser bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%);
width:165%;
/* Browser bug fix */
-webkit-transform: translateX(-100%);
/* Browser bug fix */
transform: translateX(-100%);
}
}
I found one example from this. It worked fine, but anybody knows how to make scrolling start immediately and after it finish scroll from right to left, immediately it start again. Because right now it wait about 3 second to start scrolling. Thanks.
Below is the CSS:
.example1 {
height: 50px;
overflow: hidden;
position: relative;
}
.example1 h3 {
position: absolute;
width: 100%;
height: 100%;
margin: 0;
line-height: 50px;
text-align: center;
/* Starting position */
-moz-transform:translateX(100%);
-webkit-transform:translateX(100%);
transform:translateX(100%);
/* Apply animation to this element */
-moz-animation: example1 10s linear infinite;
-webkit-animation: example1 10s linear infinite;
animation: example1 10s linear infinite;
}
/* Move it (define the animation) */
#-moz-keyframes example1 {
0% { -moz-transform: translateX(100%); }
100% { -moz-transform: translateX(-100%); }
}
#-webkit-keyframes example1 {
0% { -webkit-transform: translateX(100%); }
100% { -webkit-transform: translateX(-100%); }
}
#keyframes example1 {
0% {
-moz-transform: translateX(100%); /* Firefox bug fix */
-webkit-transform: translateX(100%); /* Firefox bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%); /* Firefox bug fix */
-webkit-transform: translateX(-100%); /* Firefox bug fix */
transform: translateX(-100%);
}
}
From the example you have shown, all you need to do is add the following styles. .example1 h3 {display: inline-block; width: auto;} and change the animation to about 5s intervals.
The reason it scrolls late is because the width of the h3 is the full width of the screen/div with a centered text so it will be delayed by default.