Jump to content
Search Community

Split Text wiered issue - character spreads to full width

surya_mayekar@rediffmail.com test
Moderator Tag

Recommended Posts

Hello,

 

I am facing wiered issue while animating text inside h1, first time it animate correctly, but if i reload page, the text spreads to full width of screen.

My html is as follows:

<h1>
                <span class="main-txt mr">C<span class="split">hirag</span></span>
                <span class="main-txt">S<span class="split">abhnani</span></span>
  </h1>

 

CSS:

.main-txt{
  color$yellow;
  font-family'Gorgeous-Thin';
  font-size17rem;
  font-size22.5rem;
  line-height10rem;
  text-transformuppercase;
  margin-bottom20px;
  positionrelative;
  @media (max-width:768px) {
    text-aligncenter;
  }
 
  &:nth-child(1){
    margin-right-17px;
    margin-right-27px;
  }
  &:nth-child(2){
    margin-left-17px;
  }
 
  > span{
    line-height0;
  }
 
}
.mr{
  displayinline-block;
  @media (max-width:768px) {
    margin-right0;
  }
}

 

JS

var currentDynamicPart = $('h1 .split');
var loader_logo1 = new TimelineMax()
.to('.slide1 h1'0.3,{top: 0})
.to('.slide1 h1 .main-txt'0.3,{fontSize:'17rem'})
.staggerTo(mySplitText.chars,  0.3, {autoAlpha:0,  width: 0x: '-100%'ease:Power1.easeInOut}, allDone)
.staggerFrom(mySplitText.chars0.3, {autoAlpha:0,  width: 0x: '100%'ease:Power1.easeInOut}, allDone)
.to('.slide1 h1 .mr'0.3,{margin: '0 30px 0 0'})

 

Please help on this, i am struggling to fix it since last 2-3 days, looked up in community, but no solution found.

 

split-text-issue.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...