scrollto

scrollTo with easing and a callback function

白昼怎懂夜的黑 提交于 2019-12-22 18:12:10
问题 Here is my code thus far: $('.my_button').click(function() { $.scrollTo( '#my_anchor', 1200, {easing:'easeInOutExpo'}, function() { // function not working here }); }); The callback function worked previously, but since I changed to the scrollTo method with easing, it doesn't any more! Just to make it clear I only need to know how to get my callback function working again, everything else is fine. 回答1: There is no forth parameter, but the third parameter (settings) accepts an onAfter callback

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

喜夏-厌秋 提交于 2019-12-22 05:13:42
问题 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

$(“html”).animate({ scrollTop: $(document).height() }, “slow”); if it's at the bottom don't scroll it

偶尔善良 提交于 2019-12-19 04:38:11
问题 I have three buttons which have hidden divs, when i click on one i want the content to scroll to the bottom, then when i click another I want the page to stay where it is but load the new content. I've tried variables and if statements var i=0; $('#link-slide13').click(function(){ if (i==0){//nothing's been scrolled $("html").animate({ scrollTop: $(document).height() }, "slow"); i=1; }else{ //don't do anything } }); Any ideas? Thanks for the answers! Edit: Sorry i don't really think i've

JavaScript issue with scrollTo() in Chrome

人盡茶涼 提交于 2019-12-19 02:32:07
问题 I try to create a web page with a fixed navigation bar at the top that covers the content underneath. When loading the page with an anchor in the url the normal behaviour is that the page scrolls the anchor to the top of the window. But then that content is hidden under the navigation bar. So I try to solve this problem with JavaScript scrollTo(). My solution works fine with Firefox and Opera but not in Chrome. Please try the example. Any ideas how to fix this issue in Chrome? Thank you. test

jQuery accordion, scroll beginning of clicked tab to the top, doesn't work if expanded tab is above the one being clicked?

安稳与你 提交于 2019-12-18 12:36:31
问题 Got a little bit of a problem with getting my jquery accordion to do what I want. I always want the tab that is being clicked to be scrolled to a fixed amount of pixels from the top of the page, and I kinda got it working. But whenever the active tab is above the tab being clicked and if the page already is scrolled down a bit, the top and parts of the content of the clicked tab is scrolled up past the top of the page. This is what i got: $(function() { $("#accordion").accordion({ autoHeight:

Highlight active link when using scrollto based on current view

爱⌒轻易说出口 提交于 2019-12-18 01:10:51
问题 I have a website which is one page and the user navigates to each section using links which uses the scrollto jquery plugin. My problem is: I want to show the active link in the main menu. So if you scroll to the contact form the contact link is highlighted. Now I could do this in jquery by adding the class after clicking. If done like that if a user was to manually scroll to another section the contact link would still be active, which would be incorrect and misleading. So my thoughts would

Using arrow keys with jQuery scrollTo

北慕城南 提交于 2019-12-17 20:27:10
问题 I have successfully implemented the scrollTo jQuery plugin which scrolls to the next div with the class "new" when a link is clicked. However, I would also like to be able to use the arrow keys to scroll up and down to the next/previous divs of the same class. I have looked all over the internet but have been unable to find out how to do this. I am very new to JS so very simple instructions would be appreciated! Here is the relevant code: <script type="text/javascript"> jQuery(function($){ $(

navigating to specific anchor tag from separate page w/ scroll & offset

谁说胖子不能爱 提交于 2019-12-13 03:55:06
问题 I'm building a multi-section splash page using jQuery scrollTo to navigate between sections. There's a fixed header, which scrollTo's 'offset' setting takes into account, but I'd like users to be able to navigate to specific sections (anchors on the splash page) from pages elsewhere on the site. As it stands, the offset is not being taken into account when this happens... I've tried adding margins on both the sections and the #page and body elements as well as some relative positioning here

How can I know when ItemsSource changes?

天大地大妈咪最大 提交于 2019-12-13 02:59:14
问题 How can I know when items are added to or removed from an ItemsControl . I need to scroll to the top when this happens. I know there is another post on here for doing this using behavior injection, but this doesn't work for me. ScrollToTop is called but the result is not scrolled to the top. Is there another way to do this MVVM style without behavior injection? 回答1: Look here: MSDN Forums (similar question with answers) Or here: MSDN Documentation (OnItemsSourceChanged method) 回答2: You could

scollTo + hashchange: Weird back/forward behavior

戏子无情 提交于 2019-12-13 02:27:55
问题 I'm trying to use Ariel Fiesler's scrollTo plugin in conjunction with Ben Alman's hashchange plugin. Basically I'm scrolling to different DIVs on my page, and trying to use hashchange for back/forward button functionality. It sort of works, but it's inconsistent. On every other back or forward, it scrolls. But on the others it just jumps to the scroll position. So you get something like: 1. Jump, 2. Scroll, 3. Jump, 4. Scroll and so on. Here's a link to the live site: http://www.6by7.net/ And