Angular 回到顶部 滚动到特定的页面位置
$timeout(function() {
// $location.hash('bottom');
// $anchorScroll(); // var a=angular.element("#loginPage")[0].scrollTop;
// var b=angular.element("#loginPage")[0].scrollHeight;
// angular.element("#loginPage")[0].scrollTop=b; var height = $("#loginPage").outerHeight()-110;
var width = $("#loginPage").outerWidth()-260;
$('body, html').animate({
"scrollTop" : height,
"scrollLeft" : width
}, 500);
})
<!-- Top content -->
<div ng-controller="YacmpLoginController">
<div id="loginPage" class="top-content" style="position: static;background-image: url(libs/img/backgrounds/ClearingHouseBg.png);">
<div class="container" style="width: 100%;">
<div class="row">
<div class="col-sm-12 form-box">
<div class="form-bottom">
<form role="form" action="login" method='POST' autocomplete="off" name="loginForm" novalidate>
<div style="padding-left: 192px;">
<span class="error" ng-show="errorMessage != null">{{errorMessage|translate}}</span>
</div>
<div class="form-group row">
<label class="col-sm-4 control-label">{{'User Id/Email'|translate}}:</label>
<!--<label class="sr-only" for="form-email">{{'User Id/Email'|translate}}</label>-->
<div class="col-sm-5">
<input type="text" name="username" ng-model="username" class="login-form-control" placeholder="{{ 'User Id/Email' | translate}}" id="form-email" required autocomplete="off"/>
<span class="error" ng-show="for.username.$error.required">
{{'Please input user id or email'|translate}}
</span>
</div>
</div>
<div class="form-group row">
<label class="col-sm-4 control-label">{{'Password'|translate}}:</label>
<div class="col-sm-5">
<input type="password" name="plainPwd" ng-model="password" class="login-form-control" placeholder="{{ 'Password' | translate}}" required autocomplete="off">
<input hidden name="password" value="{{passwordHash}}" />
<input hidden name="encrypted" value="{{isEncrypted}}" />
<input hidden name="loginType" value="{{loginType}}" />
</div>
<!--<div class="col-xs-6">-->
<!--<input type="checkbox" class="login-form-control"/>-->
<!--{{'Remember me'|translate}}-->
<!--</div>-->
<!--<div class="col-xs-1 pull-right">-->
<!--<a class="float-right" ng-href="#/register">{{'register'|translate}}</a>-->
<!--</div>-->
<div class="col-sm-2">
<a ng-click="forgetPassword()">{{'Forget Password'|translate}}</a>
</div>
</div> <div class="row">
<div>
<button type="submit" name="submit" value="Login" class="btn btn-primary btn-block btn-flat">{{'Sign in'|translate}}</button>
</div>
</div> <div class="form-group row">
<!--<select class="login-form-control" ng-model="selectedTenant" ng-options="t.name for t in all_tenants" required ng-disabled="all_tenants.length===1">-->
<!--</select>-->
<input hidden name="tenant" value="{{selectedTenant}}" />
</div>
</form>
</div>
</div>
</div>
</div> <a id="bottom"></a>
</div>
</div>
Angular 回到顶部 滚动到特定的页面位置的更多相关文章
- Angular回到顶部按钮指令
之前的分页代码指令化在线下测试没有问题,到服务器上就不运行了,所以那个先放一放. 今天来把"回到顶部"按钮指令化.首先是页面html: <!--回弹按钮--> < ...
- 小程序scroll-view实现回到顶部
一.wxml页面:catchtap阻止冒泡事件. <view class="gotop" hidden='{{!cangotop}}'catchtap="goTop ...
- 页面滚动事件和利用JS实现回到顶部效果
页面滚动 事件:window.onscroll, 获得页面滚动位置:document.body.scrollTop: HTML代码: 这里注意此处逻辑,大于500就显示,否则就隐藏,还有注意如果变量名 ...
- 关于angular跳转路由之后不能自动回到顶部的解决方法
Question: angular2 scroll top on router change 当我们在第一个路由滑动到底部当我们点击导航跳转到另一个路由时页面没有回到顶部而是保持上一个路由的滚动位置, ...
- 【JQ+锚标记实现点击页面回到顶部】
前言:今天想写个页面常用到的[点击回到页面顶部或是首页的功能],生活和职场一样,总会有低谷的时候,这个时候咱也别怂.别怂.别怂,说三遍!那都不是事,工作没了,再找呗,就像我上周五,团队解散那天,我是笑 ...
- js——页面回到顶部
很久都没有去慕课网学习学习了,刚恰好就看见了一个用的比较多的小例子——页面回到顶部,记得之前自己也是在初学web时,被这个坑了一回,因此今天特地拿来分享分享…… <!DOCTYPE html&g ...
- jacascript 滚动 scroll 与回到顶部
前言:这是笔者学习之后自己的理解与整理.如果有错误或者疑问的地方,请大家指正,我会持续更新! 滚动 scroll scrollHeight 表示元素的总高度,包括由于溢出而无法展示在网页的不可见部分: ...
- jQuery实现页面回到顶部功能
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- js刷新页面不回到顶部
今天遇到刷新页面不回到顶部的需求 window.location.reload();方法已经解决了问题,但是ie8不支持,后来采用的是锚点这个方法 window.location = '/plan/g ...
随机推荐
- vmware无法打开内核设备“\\.\Global\vmx86”: 系统找不到指定的文件
原因: 是虚拟机服务没有开启 解决方法:(以管理员的方式运行) 点击“开始→运行”,在运行框中输入 CMD 回车打开命令提示符,然后依次执行以下命令. net start vmcinet start ...
- nginx的 keepalive_timeout参数是一个请求完成之后还要保持连
keepalive_timeout参数是一个请求完成之后还要保持连接多久,不是请求时间多久,目的是保持长连接,减少创建连接过程给系统带来的性能损耗,类似于线程池,数据库连接池. [root@web01 ...
- SSH无密码验证配置
一. 准备工作 首先要确保你的linux系统中已经安装了ssh,对于ubuntu系统一般默认只安装了ssh client,所以还需要我们手动安装ssh server: sudo apt-get ins ...
- php -- ziparchive::open创建zip压缩文件
语法: mixed ZipArchive::open ( string $filename [, int $flags ] ) 参数: filename:创建的zip的文件名 flags: ZIPAR ...
- 分享在github超酷超炫特效动画,不看你会懊悔的。
有图有真相直接上效果图,有须要的朋友们能够到连接上去下载. 下载地址:https://github.com/ChrisRenke/DrawerArrowDrawable 下载地址:https://gi ...
- 深入分析jquery解析json数据
我们先以解析上例中的comments对象的JSON数据为例,然后再小结jQuery中解析JSON数据的方法. JSON数据如下,是一个嵌套JSON: {"comments":[{& ...
- React + Redux 入门(一):抛开 React 学 Redux
http://www.hacke2.cn/think-in-react-redux-1/
- C static 关键字理解
今天来看一下这么一个程序. #include<stdio.h> int count =1; int fun(void) { static int count =10; return cou ...
- 面试题思考:Java RMI与RPC,JMS的比较
RPC:(Remote Procedure Call) 被设计为在应用程序间通信的平台中立的方式,它不理会操作系统之间以及语言之间的差异. 支持多语言 RMI:(Remote Method Invo ...
- 部分常用dos命令
Microsoft Windows XP [版本 ] (C) 版权所有 - Microsoft Corp. C:\Documents and Settings\Administrator>d: ...