Jump to content
Search Community

surya_mayekar@rediffmail.com

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by surya_mayekar@rediffmail.com

  1. 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

×
×
  • Create New...