"Button "top""
Bootstrap 4.1.1 Snippet by irbees2008

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/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="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> <nav class="navbar navbar-light bg-white"> <a href="#" class="navbar-brand">Кнопка ВВЕРХ</a> <form class="form-inline"> <div class="input-group"> <input type="text" class="form-control" aria-label="Recipient's username" aria-describedby="button-addon2"> <div class="input-group-append"> <button class="btn btn-outline-primary" type="button" id="button-addon2"> <i class="fa fa-search"></i> </button> </div> </div> </form> </nav> <div class="container-fluid gedf-wrapper"> <div class="row"> <div class="col-md-3"> <div class="card"> <div class="card-body"> <div class="h5">@LeeCross</div> <div class="h7 text-muted">Fullname : Miracles Lee Cross</div> <div class="h7">Developer of web applications, JavaScript, PHP, Java, Python, Ruby, Java, Node.js, etc. </div> </div> <ul class="list-group list-group-flush"> <li class="list-group-item"> <div class="h6 text-muted">Followers</div> <div class="h5">5.2342</div> </li> <li class="list-group-item"> <div class="h6 text-muted">Following</div> <div class="h5">6758</div> </li> <li class="list-group-item">Vestibulum at eros</li> </ul> </div> </div> <div class="col-md-6 gedf-main"> <!--- \\\\\\\Post--> <div class="card gedf-card"> <div class="card-header"> <ul class="nav nav-tabs card-header-tabs" id="myTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="posts-tab" data-toggle="tab" href="#posts" role="tab" aria-controls="posts" aria-selected="true">Make a publication</a> </li> <li class="nav-item"> <a class="nav-link" id="images-tab" data-toggle="tab" role="tab" aria-controls="images" aria-selected="false" href="#images">Images</a> </li> </ul> </div> <div class="card-body"> <div class="tab-content" id="myTabContent"> <div class="tab-pane fade show active" id="posts" role="tabpanel" aria-labelledby="posts-tab"> <div class="form-group"> <label class="sr-only" for="message">post</label> <textarea class="form-control" id="message" rows="3" placeholder="What are you thinking?"></textarea> </div> </div> <div class="tab-pane fade" id="images" role="tabpanel" aria-labelledby="images-tab"> <div class="form-group"> <div class="custom-file"> <input type="file" class="custom-file-input" id="customFile"> <label class="custom-file-label" for="customFile">Upload image</label> </div> </div> <div class="py-4"></div> </div> </div> <div class="btn-toolbar justify-content-between"> <div class="btn-group"> <button type="submit" class="btn btn-primary">share</button> </div> <div class="btn-group"> <button id="btnGroupDrop1" type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-globe"></i> </button> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="btnGroupDrop1"> <a class="dropdown-item" href="#"><i class="fa fa-globe"></i> Public</a> <a class="dropdown-item" href="#"><i class="fa fa-users"></i> Friends</a> <a class="dropdown-item" href="#"><i class="fa fa-user"></i> Just me</a> </div> </div> </div> </div> </div> <!-- Post /////--> <!--- \\\\\\\Post--> <div class="card gedf-card"> <div class="card-header"> <div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center"> <div class="mr-2"> <img class="rounded-circle" width="45" src="https://picsum.photos/50/50" alt=""> </div> <div class="ml-2"> <div class="h5 m-0">@LeeCross</div> <div class="h7 text-muted">Miracles Lee Cross</div> </div> </div> <div> <div class="dropdown"> <button class="btn btn-link dropdown-toggle" type="button" id="gedf-drop1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-ellipsis-h"></i> </button> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="gedf-drop1"> <div class="h6 dropdown-header">Configuration</div> <a class="dropdown-item" href="#">Save</a> <a class="dropdown-item" href="#">Hide</a> <a class="dropdown-item" href="#">Report</a> </div> </div> </div> </div> </div> <div class="card-body"> <div class="text-muted h7 mb-2"> <i class="fa fa-clock-o"></i>10 min ago</div> <a class="card-link" href="#"> <h5 class="card-title">Lorem ipsum dolor sit amet, consectetur adip.</h5> </a> <p class="card-text"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo recusandae nulla rem eos ipsa praesentium esse magnam nemo dolor sequi fuga quia quaerat cum, obcaecati hic, molestias minima iste voluptates. </p> </div> <div class="card-footer"> <a href="#" class="card-link"><i class="fa fa-gittip"></i> Like</a> <a href="#" class="card-link"><i class="fa fa-comment"></i> Comment</a> <a href="#" class="card-link"><i class="fa fa-mail-forward"></i> Share</a> </div> </div> <!-- Post /////--> <!--- \\\\\\\Post--> <div class="card gedf-card"> <div class="card-header"> <div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center"> <div class="mr-2"> <img class="rounded-circle" width="45" src="https://picsum.photos/50/50" alt=""> </div> <div class="ml-2"> <div class="h5 m-0">@LeeCross</div> <div class="h7 text-muted">Miracles Lee Cross</div> </div> </div> <div> <div class="dropdown"> <button class="btn btn-link dropdown-toggle" type="button" id="gedf-drop1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-ellipsis-h"></i> </button> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="gedf-drop1"> <div class="h6 dropdown-header">Configuration</div> <a class="dropdown-item" href="#">Save</a> <a class="dropdown-item" href="#">Hide</a> <a class="dropdown-item" href="#">Report</a> </div> </div> </div> </div> </div> <div class="card-body"> <div class="text-muted h7 mb-2"> <i class="fa fa-clock-o"></i> 10 min ago</div> <a class="card-link" href="#"> <h5 class="card-title"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit consectetur deserunt illo esse distinctio.</h5> </a> <p class="card-text"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam omnis nihil, aliquam est, voluptates officiis iure soluta alias vel odit, placeat reiciendis ut libero! Quas aliquid natus cumque quae repellendus. Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa, excepturi. Doloremque, reprehenderit! Quos in maiores, soluta doloremque molestiae reiciendis libero expedita assumenda fuga quae. Consectetur id molestias itaque facere? Hic! </p> <div> <span class="badge badge-primary">JavaScript</span> <span class="badge badge-primary">Android</span> <span class="badge badge-primary">PHP</span> <span class="badge badge-primary">Node.js</span> <span class="badge badge-primary">Ruby</span> <span class="badge badge-primary">Paython</span> </div> </div> <div class="card-footer"> <a href="#" class="card-link"><i class="fa fa-gittip"></i> Like</a> <a href="#" class="card-link"><i class="fa fa-comment"></i> Comment</a> <a href="#" class="card-link"><i class="fa fa-mail-forward"></i> Share</a> </div> </div> <!-- Post /////--> <!--- \\\\\\\Post--> <div class="card gedf-card"> <div class="card-header"> <div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center"> <div class="mr-2"> <img class="rounded-circle" width="45" src="https://picsum.photos/50/50" alt=""> </div> <div class="ml-2"> <div class="h5 m-0">@LeeCross</div> <div class="h7 text-muted">Miracles Lee Cross</div> </div> </div> <div> <div class="dropdown"> <button class="btn btn-link dropdown-toggle" type="button" id="gedf-drop1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-ellipsis-h"></i> </button> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="gedf-drop1"> <div class="h6 dropdown-header">Configuration</div> <a class="dropdown-item" href="#">Save</a> <a class="dropdown-item" href="#">Hide</a> <a class="dropdown-item" href="#">Report</a> </div> </div> </div> </div> </div> <div class="card-body"> <div class="text-muted h7 mb-2"> <i class="fa fa-clock-o"></i> Hace 40 min</div> <a class="card-link" href="#"> <h5 class="card-title">Код кнопки</h5> </a> <p class="card-text"> Код кнопки ниже отмечен комментариями, стили и скрипт где положенно. </p> </div> <div class="card-footer"> <a href="#" class="card-link"><i class="fa fa-gittip"></i> Like</a> <a href="#" class="card-link"><i class="fa fa-comment"></i> Comment</a> <a href="#" class="card-link"><i class="fa fa-mail-forward"></i> Share</a> </div> </div> <!-- Post /////--> </div> <div class="col-md-3"> <div class="card gedf-card"> <div class="card-body"> <h5 class="card-title">Card title</h5> <h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6> <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="#" class="card-link">Card link</a> <a href="#" class="card-link">Another link</a> </div> </div> <div class="card gedf-card"> <div class="card-body"> <h5 class="card-title">Card title</h5> <h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6> <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="#" class="card-link">Card link</a> <a href="#" class="card-link">Another link</a> </div> </div> </div> </div> </div> <!-- Кнопка ВВЕРХ --> <div class="scrollup"> <i class="fa fa-angle-double-up"></i> </div> <!-- Кнопка ВВЕРХ -->
div.scrollup { position: fixed; /* фиксированная позиция */ color: #30e3ca; /* цвет текста */ right: 20px; /* расстояние от правого края */ bottom: 0px; /* расстояние от нижнего края */ font-size: 70px; /* размер шрифта (иконки) */ cursor: pointer; /* форма курсора */ display: none; /* не отображать элемент */ text-align: center; /*выравнивание содержимого элемента по центру */ } div.scrollup:hover { color: #ff1000; /* цвет заднего фона при наведении */ }
$(function() { // при нажатии на кнопку scrollup $('.scrollup').click(function() { // переместиться в верхнюю часть страницы $("html, body").animate({ scrollTop:0 },1000); }) }) // при прокрутке окна (window) $(window).scroll(function() { // если пользователь прокрутил страницу более чем на 200px if ($(this).scrollTop()>200) { // то сделать кнопку scrollup видимой $('.scrollup').fadeIn(); } // иначе скрыть кнопку scrollup else { $('.scrollup').fadeOut(); } });

Related: See More


Questions / Comments: