scrollto

Simple “scroll to/down” effect using minimal markup and hash tags

喜欢而已 提交于 2019-12-05 06:58:55
I am making a one page site that has a classic navigation at the top. Right now I have links set up as hash tags in order to navigate within the page: <nav> <a href="#about">About</a> </nav> ... <section id="about">...</section> Obviously, this works but the jump to the about section is instant and not gradual. I am looking for an extremely simple implementation in order to make a gradual transition. I don't want anything fancy. No axis, offset, or any other options. I just want the scroll transition to be gradual. The only setting I want is the time it takes to finish the scroll. Also, I want

scrollTo() with ipad and fixed element [duplicate]

岁酱吖の 提交于 2019-12-05 06:15:20
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Mobile Safari bug on fixed positioned button after scrollTop programmatically changed…? We're trying to put a fixed navigation to scroll the different sections of a page. We're using jquery scrollTo(). Only on ipad, the first click pass without problem, but after this one, the on the navigation seems to be disabled. If we scroll, even a little bit, with the hand, then the link's work again. Here is the code :

Jquery ScrollTo Easing

时光毁灭记忆、已成空白 提交于 2019-12-05 05:17:10
Can´t apply an easing method to Jquery ScrollTo: $("#scroller").scrollTo(target,1000,{axis:'x',easing:'linear'}); This doesn´t ease anything... Im starting to use jquery now (been using prototype for long) so this is surely my mistake. Do I need an easing plugin to achieve this? What are the easing option for this plugin (if any)? The documentation is not clear about this. Thanks. From jQuery: The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear . So easing: 'linear' is not supposed to show anything. Try

jQuery LocalScroll + hashchange event browser compatibility issue

主宰稳场 提交于 2019-12-04 21:24:14
I'm building a site where I am using Ariel Fleslers jQuery LocalScroll plugin , which I want to do two things: 1) Animate a scroll to an anchor when a link is clicked 2) Scroll to the previously visited anchor when the browsers' back button is pressed. The scrolling takes place inside a container where the content is overflowing. Number one was straight forward enough. To acheive number two I did a fair bit of googling but didn't really find a solution, even though I came across a few posts by people who were looking to do something similar. I ended up using Ben Almans jQuery hashchange event

Scrolling down to next element via keypress & scrollTo plugin - jQuery

那年仲夏 提交于 2019-12-04 16:39:33
I am using jQuery's scrollTo plugin to scroll up and down my page, using UP arrow and DOWN arrow. i have a bunch of div with class "screen", as so: <div class="screen-wrapper">...</div> What I am trying to do is, when i press UP or DOWN, the window scrolls to the next, or previous div with class of "screen". I have the keypresses taken care of. According to the plugin docs, to scroll a window, you use $.scrollTo(...); Here's the code I have: $(document).keypress(function(e){ switch (e.keyCode) { case 40: // down n = $('.screen-wrapper').next() $.scrollTo( n, 800 ); break; case 38: // up break;

这15个Vue指令,让你的项目开发爽到爆

痴心易碎 提交于 2019-12-04 15:22:03
1. V-Hotkey 仓库地址 : github.com/Dafrok/v-ho… Demo : 戳这里 https://dafrok.github.io/v-hotkey 安装 : npm install --save v-hotkey 这个指令可以给组件绑定一个或多个快捷键。你想要通过按下 Escape 键后隐藏某个组件,按住 Control 和回车键再显示它吗?小菜一碟: <template> <div v-show="show" v-hotkey="{ 'esc': onClose, 'ctrl+enter': onShow }" > Press `esc` to close me! </div> </template> <script> export default { data() { return { show: true } }, methods: { onClose() { this.show = false }, onShow() { this.show = true }, } } </script> 复制代码 2. V-Click-Outside 仓库地址 : github.com/ndelvalle/v… Demo : codesandbox.io/s/zx7mx8y1o… 安装 : npm install --save v-click-outside

Scrolling to the next element

℡╲_俬逩灬. 提交于 2019-12-04 13:35:39
I'm struggling with a jquery or javascript problem. It already got annoying which tells me I might think too complicated on this one. So my markup (simplyfied) looks like this: <div class="container"> My Content <a href="#" class="button">scroll down</a> </div> <div class="container"> My Content <a href="#" class="button">scroll down</a> </div> <div class="container"> My Content <a href="#" class="button">scroll down</a> </div> <div class="container"> My Content <a href="#" class="button">scroll down</a> </div> Basically just some containers. Each one contains different content and a button.

When form is validated, how to SCROLL to the first error instead of jumping?

孤街浪徒 提交于 2019-12-04 07:31:41
问题 I've seen many questions with variations on this theme, but I'm looking for the straightforward solution: HTML form, jQuery validation, multiple fields are required. When the form is submitted, validation jumps to the first error and highlights it. To increase usability, I want to scroll to that first error field. But it keeps blowing up the validation entirely or throwing scrollTo errors. I need to use the standard validation plugin (http://docs.jquery.com/Plugins/Validation) but any

Simple jQuery not working in IE

半城伤御伤魂 提交于 2019-12-03 17:24:13
I jsut now noticed that some simple jQuery is not working on IE9 and IE10 for mobile. I have some copyright links and simple sliding contact form which uses animate(). Also I use scrollTo plugin in combination with jQuery. I tried different versions, and still no solution. Maybe I am missing something obvious. Here is the code for one copyright link and for contact form to open and close. $('#privacy').click(function(){ $('#copyright').hide('fast'); $('#policy').toggle('slow'); $.scrollTo('+=800px', 800, { axis:'y' }); }); $('#plusSign').click(function(){ if ($('#contactFormHolder').hasClass(

jQuery: move window viewport to show freshly toggled element

回眸只為那壹抹淺笑 提交于 2019-12-03 07:20:42
问题 I have a snippet of jQuery in doc ready which toggles a div containing a textarea : $('div#addnote-area').hide(); // hide the div $('a#addnote-link').click(function() { // click event listener on link $('div#addnote-area').toggle(); // toggle the hidden div }); The toggle works fine when clicking the link. The problem I'm having is that if div#addnote-area is below the browser's current viewport, it remains there when it's shown. I'd like the user's cursor to go to the textarea and for the