why the search bar move at the end of the slide Toggle Animation?












0















in the mobile view, I want to make an animation (the transition from display none to display block) to show links of login and Create a new account etc
the animation works good but I want the search bar keep his position I don't know why it moves after displaying information



jsfiddle here



the second problem is when I resize the view to the desktop view I want to hide information with animation of slide toggle I have tried to make :



@media only screen and (min-width: 700px){
.resp-toggle1 {
display: none;
}
}


but doesn't works and also with jquery :



 $(window).resize(function(){
var winwidth = $(window).innerWidth();
if(winwidth > 768){
$('.resp-toggle1').toggleClass( 'disable' );
}
});





$(document).ready(function(){
$('.menu-toggle').click(function(){
$('.resp-toggle1').slideToggle( "0.01s" );
});
});

$(window).resize(function(){
var winwidth = $(window).innerWidth();
if(winwidth > 768){
$('.resp-toggle1').toggleClass( 'disable' );
}
});

@media only screen and (min-width: 700px){
.resp-toggle1 {
display: none;
}
}

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR" class="gr__localhost">
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body class="has-searchbox home" data-gr-c-s-loaded="true">
<div id="header">
<!-- header ad 728x60-->
<div class="wrapper">
<div id="logo">
<a href="">Website</a>
<span id="description"></span>
</div>
<div class="menu-toggle">
<i class="fa fa-bars fa-3x"></i>
</div>
<ul class="resp-toggle1" style="display: block;">
<li><a href="">Login</a></li>
<li><a href="">Create a new account</a></li>
<li class="publish"><a href="">Pub</a></li>
</ul>
</div>
<form action="" method="get" class="search nocsrf">
<input type="hidden" name="page" value="search">
<div class="main-search">
<div class="cell">
<div class="has-placeholder input-text"><label>Search : </label><input type="text" name="sPattern" id="query" class="input-text" value=""></div>
</div>
<div class="cell">
<div class="has-placeholder input-text"></div>
</div>
</div>
</form>
</div>
</body>
</html>





thanks for help by advance










share|improve this question





























    0















    in the mobile view, I want to make an animation (the transition from display none to display block) to show links of login and Create a new account etc
    the animation works good but I want the search bar keep his position I don't know why it moves after displaying information



    jsfiddle here



    the second problem is when I resize the view to the desktop view I want to hide information with animation of slide toggle I have tried to make :



    @media only screen and (min-width: 700px){
    .resp-toggle1 {
    display: none;
    }
    }


    but doesn't works and also with jquery :



     $(window).resize(function(){
    var winwidth = $(window).innerWidth();
    if(winwidth > 768){
    $('.resp-toggle1').toggleClass( 'disable' );
    }
    });





    $(document).ready(function(){
    $('.menu-toggle').click(function(){
    $('.resp-toggle1').slideToggle( "0.01s" );
    });
    });

    $(window).resize(function(){
    var winwidth = $(window).innerWidth();
    if(winwidth > 768){
    $('.resp-toggle1').toggleClass( 'disable' );
    }
    });

    @media only screen and (min-width: 700px){
    .resp-toggle1 {
    display: none;
    }
    }

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR" class="gr__localhost">
    <head>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    </head>
    <body class="has-searchbox home" data-gr-c-s-loaded="true">
    <div id="header">
    <!-- header ad 728x60-->
    <div class="wrapper">
    <div id="logo">
    <a href="">Website</a>
    <span id="description"></span>
    </div>
    <div class="menu-toggle">
    <i class="fa fa-bars fa-3x"></i>
    </div>
    <ul class="resp-toggle1" style="display: block;">
    <li><a href="">Login</a></li>
    <li><a href="">Create a new account</a></li>
    <li class="publish"><a href="">Pub</a></li>
    </ul>
    </div>
    <form action="" method="get" class="search nocsrf">
    <input type="hidden" name="page" value="search">
    <div class="main-search">
    <div class="cell">
    <div class="has-placeholder input-text"><label>Search : </label><input type="text" name="sPattern" id="query" class="input-text" value=""></div>
    </div>
    <div class="cell">
    <div class="has-placeholder input-text"></div>
    </div>
    </div>
    </form>
    </div>
    </body>
    </html>





    thanks for help by advance










    share|improve this question



























      0












      0








      0








      in the mobile view, I want to make an animation (the transition from display none to display block) to show links of login and Create a new account etc
      the animation works good but I want the search bar keep his position I don't know why it moves after displaying information



      jsfiddle here



      the second problem is when I resize the view to the desktop view I want to hide information with animation of slide toggle I have tried to make :



      @media only screen and (min-width: 700px){
      .resp-toggle1 {
      display: none;
      }
      }


      but doesn't works and also with jquery :



       $(window).resize(function(){
      var winwidth = $(window).innerWidth();
      if(winwidth > 768){
      $('.resp-toggle1').toggleClass( 'disable' );
      }
      });





      $(document).ready(function(){
      $('.menu-toggle').click(function(){
      $('.resp-toggle1').slideToggle( "0.01s" );
      });
      });

      $(window).resize(function(){
      var winwidth = $(window).innerWidth();
      if(winwidth > 768){
      $('.resp-toggle1').toggleClass( 'disable' );
      }
      });

      @media only screen and (min-width: 700px){
      .resp-toggle1 {
      display: none;
      }
      }

      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR" class="gr__localhost">
      <head>
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
      </head>
      <body class="has-searchbox home" data-gr-c-s-loaded="true">
      <div id="header">
      <!-- header ad 728x60-->
      <div class="wrapper">
      <div id="logo">
      <a href="">Website</a>
      <span id="description"></span>
      </div>
      <div class="menu-toggle">
      <i class="fa fa-bars fa-3x"></i>
      </div>
      <ul class="resp-toggle1" style="display: block;">
      <li><a href="">Login</a></li>
      <li><a href="">Create a new account</a></li>
      <li class="publish"><a href="">Pub</a></li>
      </ul>
      </div>
      <form action="" method="get" class="search nocsrf">
      <input type="hidden" name="page" value="search">
      <div class="main-search">
      <div class="cell">
      <div class="has-placeholder input-text"><label>Search : </label><input type="text" name="sPattern" id="query" class="input-text" value=""></div>
      </div>
      <div class="cell">
      <div class="has-placeholder input-text"></div>
      </div>
      </div>
      </form>
      </div>
      </body>
      </html>





      thanks for help by advance










      share|improve this question
















      in the mobile view, I want to make an animation (the transition from display none to display block) to show links of login and Create a new account etc
      the animation works good but I want the search bar keep his position I don't know why it moves after displaying information



      jsfiddle here



      the second problem is when I resize the view to the desktop view I want to hide information with animation of slide toggle I have tried to make :



      @media only screen and (min-width: 700px){
      .resp-toggle1 {
      display: none;
      }
      }


      but doesn't works and also with jquery :



       $(window).resize(function(){
      var winwidth = $(window).innerWidth();
      if(winwidth > 768){
      $('.resp-toggle1').toggleClass( 'disable' );
      }
      });





      $(document).ready(function(){
      $('.menu-toggle').click(function(){
      $('.resp-toggle1').slideToggle( "0.01s" );
      });
      });

      $(window).resize(function(){
      var winwidth = $(window).innerWidth();
      if(winwidth > 768){
      $('.resp-toggle1').toggleClass( 'disable' );
      }
      });

      @media only screen and (min-width: 700px){
      .resp-toggle1 {
      display: none;
      }
      }

      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR" class="gr__localhost">
      <head>
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
      </head>
      <body class="has-searchbox home" data-gr-c-s-loaded="true">
      <div id="header">
      <!-- header ad 728x60-->
      <div class="wrapper">
      <div id="logo">
      <a href="">Website</a>
      <span id="description"></span>
      </div>
      <div class="menu-toggle">
      <i class="fa fa-bars fa-3x"></i>
      </div>
      <ul class="resp-toggle1" style="display: block;">
      <li><a href="">Login</a></li>
      <li><a href="">Create a new account</a></li>
      <li class="publish"><a href="">Pub</a></li>
      </ul>
      </div>
      <form action="" method="get" class="search nocsrf">
      <input type="hidden" name="page" value="search">
      <div class="main-search">
      <div class="cell">
      <div class="has-placeholder input-text"><label>Search : </label><input type="text" name="sPattern" id="query" class="input-text" value=""></div>
      </div>
      <div class="cell">
      <div class="has-placeholder input-text"></div>
      </div>
      </div>
      </form>
      </div>
      </body>
      </html>





      thanks for help by advance






      $(document).ready(function(){
      $('.menu-toggle').click(function(){
      $('.resp-toggle1').slideToggle( "0.01s" );
      });
      });

      $(window).resize(function(){
      var winwidth = $(window).innerWidth();
      if(winwidth > 768){
      $('.resp-toggle1').toggleClass( 'disable' );
      }
      });

      @media only screen and (min-width: 700px){
      .resp-toggle1 {
      display: none;
      }
      }

      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR" class="gr__localhost">
      <head>
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
      </head>
      <body class="has-searchbox home" data-gr-c-s-loaded="true">
      <div id="header">
      <!-- header ad 728x60-->
      <div class="wrapper">
      <div id="logo">
      <a href="">Website</a>
      <span id="description"></span>
      </div>
      <div class="menu-toggle">
      <i class="fa fa-bars fa-3x"></i>
      </div>
      <ul class="resp-toggle1" style="display: block;">
      <li><a href="">Login</a></li>
      <li><a href="">Create a new account</a></li>
      <li class="publish"><a href="">Pub</a></li>
      </ul>
      </div>
      <form action="" method="get" class="search nocsrf">
      <input type="hidden" name="page" value="search">
      <div class="main-search">
      <div class="cell">
      <div class="has-placeholder input-text"><label>Search : </label><input type="text" name="sPattern" id="query" class="input-text" value=""></div>
      </div>
      <div class="cell">
      <div class="has-placeholder input-text"></div>
      </div>
      </div>
      </form>
      </div>
      </body>
      </html>





      $(document).ready(function(){
      $('.menu-toggle').click(function(){
      $('.resp-toggle1').slideToggle( "0.01s" );
      });
      });

      $(window).resize(function(){
      var winwidth = $(window).innerWidth();
      if(winwidth > 768){
      $('.resp-toggle1').toggleClass( 'disable' );
      }
      });

      @media only screen and (min-width: 700px){
      .resp-toggle1 {
      display: none;
      }
      }

      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR" class="gr__localhost">
      <head>
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
      </head>
      <body class="has-searchbox home" data-gr-c-s-loaded="true">
      <div id="header">
      <!-- header ad 728x60-->
      <div class="wrapper">
      <div id="logo">
      <a href="">Website</a>
      <span id="description"></span>
      </div>
      <div class="menu-toggle">
      <i class="fa fa-bars fa-3x"></i>
      </div>
      <ul class="resp-toggle1" style="display: block;">
      <li><a href="">Login</a></li>
      <li><a href="">Create a new account</a></li>
      <li class="publish"><a href="">Pub</a></li>
      </ul>
      </div>
      <form action="" method="get" class="search nocsrf">
      <input type="hidden" name="page" value="search">
      <div class="main-search">
      <div class="cell">
      <div class="has-placeholder input-text"><label>Search : </label><input type="text" name="sPattern" id="query" class="input-text" value=""></div>
      </div>
      <div class="cell">
      <div class="has-placeholder input-text"></div>
      </div>
      </div>
      </form>
      </div>
      </body>
      </html>






      jquery html css animation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 29 '18 at 16:50









      Alireza

      1,0791924




      1,0791924










      asked Dec 29 '18 at 16:09









      jack johnjack john

      356




      356
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53971155%2fwhy-the-search-bar-move-at-the-end-of-the-slide-toggle-animation%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53971155%2fwhy-the-search-bar-move-at-the-end-of-the-slide-toggle-animation%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas