anchor-scroll

Scroll to anchor after page load in Angular

倾然丶 夕夏残阳落幕 提交于 2019-11-30 11:06:51
I need to set an ng-click event so that that it loads a new page, and then, once the page has loaded, scrolls to an anchor point on the page. I've tried every solution proposed on this SO post but I can't get it to work correctly. Most of those solutions center around scrolling to an anchor on a page that's already loaded. I need the scroll to occur after a new page has loaded. Here is my view code: <div class="see-jobs-btn" ng-click="$event.stopPropagation();goToResultJobs(r)">See Jobs</div> This represents a button inside a 'profile card'. When the user clicks on the card, it takes them to a

AngularJS is putting forward slash / after hash tag

好久不见. 提交于 2019-11-29 06:50:29
I'm trying to use AngularJS $anchorScroll with $location.hash . However, when I set the hash, AngularJS adds a forward slash, / after it. For example, the url is: http://localhost:13060/Dashboard . When I don't include the AngularJS library, I can click the link, #contact , and go to http://localhost:13060/Dashboard#contact . But when I include AngularJS and click the link, it goes to http://localhost:13060/Dashboard#/contact preventing $anchorScroll from working. Edit $anchorScroll not working The starting URL is http://localhost:13060/Category . When I add a category, it should go to http:/

Angular4 - Scrolling to anchor

為{幸葍}努か 提交于 2019-11-29 05:34:52
问题 I am trying to do a simple scroll to an anchor element on the same page. Basically, the person clicks on a "Try It" button and it scrolls to an area lower on the page with the id "login". Right now, it is working with a basic id="login" & <a href="#login"></a> but it is jumping to that section. Ideally, I would like it to scroll there. If I am using Angular4, is there some built in way to do this or what is the easiest way? Thanks! Whole template... (component still empty) <div id="image

Auto-Scroll to next anchor at Mouse-wheel

不羁的心 提交于 2019-11-27 19:55:09
I have 5 anchors on my html page. Is there any way that the page scrolls automatically to the next anchor (#) by a single Mouse-wheel scroll? Is there a way that it happens regardless of the anchor's name? just to the next anchor. This works in Chrome, IE, Firefox, Opera, and Safari: (function() { var delay = false; $(document).on('mousewheel DOMMouseScroll', function(event) { event.preventDefault(); if(delay) return; delay = true; setTimeout(function(){delay = false},200) var wd = event.originalEvent.wheelDelta || -event.originalEvent.detail; var a= document.getElementsByTagName('a'); if(wd <

AngularJS - $anchorScroll smooth/duration

独自空忆成欢 提交于 2019-11-27 17:04:07
Reading the AngularJS docs I haven't figured out if $anchorScroll can have a duration/easing option to smooth scroll to elements. It only says: $location.hash('bottom'); // call $anchorScroll() $anchorScroll(); I do not use jquery and don't want to; is there still a clever yet simple way to make or extend $anchorScroll in order to make scrolling more smooth? Unfortunately this is not possible using $anchorScroll . As you discovered $anchorScroll doesn't have any options and doesn't work with $ngAnimate . In order to animate the scroll you would need to use your own service/factory or just

AngularJS - $anchorScroll smooth/duration

一笑奈何 提交于 2019-11-26 18:49:55
问题 Reading the AngularJS docs I haven't figured out if $anchorScroll can have a duration/easing option to smooth scroll to elements. It only says: $location.hash('bottom'); // call $anchorScroll() $anchorScroll(); I do not use jquery and don't want to; is there still a clever yet simple way to make or extend $anchorScroll in order to make scrolling more smooth? 回答1: Unfortunately this is not possible using $anchorScroll . As you discovered $anchorScroll doesn't have any options and doesn't work