HTML应该像以下一样(抱歉格式和格式,但我不知道如何发布HTML示例)
<div id="dialog-window">
<div id="scrollable-content">
what ever content here...div's, ul's and li's
</div>
<div id="footer">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我正在寻找的结果是始终只有内容的垂直滚动条,页脚应始终在对话框窗口的底部可见.对话窗口是固定大小的对话框.
我已尝试过其他帖子中的一些想法,但不符合所有要求.使用CSS做任何想法(js和jquery也欢迎)
我正在尝试使用Angular JS指令来居中div的内容.
这是模板的简化版本:
<div id="mosaic" class="span12 clearfix" s-center-content>
<div ng-repeat="item in hits" id="{{item._id}}" >
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是指令:
module.directive('sCenterContent', function() {
var refresh = function(element){
var aWidth= element.innerWidth();
var cWidth= element.children()[0].offsetWidth;
var cHeight= element.children()[0].offsetHeight;
var perRow= Math.floor(aWidth/cWidth);
var margin=(aWidth-perRow*cWidth)/2;
if(perRow==0){
perRow=1;
}
var top=0;
element.children().each(function(index, child){
$(child).css('margin-left','0px');
if((index % perRow)==0){
$(child).css('margin-left',margin+'px');
}
});
};
return {
link : function(scope, element, attrs) {
$(window).resize(function(event){
refresh(element);
});
}
};
});
Run Code Online (Sandbox Code Playgroud)
它基本上浮动一些内部div并为每行中的第一个div添加一个边距,因此内容居中.
调整浏览器大小时,这可以正常工作.当我尝试在初始化后进行刷新时出现问题.
我已尝试使用此问题中所见的帖子链接功能.预链接和后链接函数按预期顺序调用,但不会在具有s-center-content指令的elemenet的子节点被渲染之后调用.由于没有找到孩子,因此刷新调用失败.
如何打电话刷新以确保孩子们已被处理?
我有以下AngularJS应用程序,包括template(index.html),app definition(app.js),控制器定义(controllers.js)和托管页面(host.jsp).
代码如下:
search.jsp的
<div class="container-fluid" ng-app="facetedSearch">
<div class="row-fluid" ng-view>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
<script src="/resources/js/page/search/app.js"></script>
<script src="/resources/js/page/search/controllers.js"></script>
Run Code Online (Sandbox Code Playgroud)
app.js
angular.module('MyApp', []).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {templateUrl:'/index.html', controller: MyController}).
otherwise({redirectTo: '/'});
}]);
Run Code Online (Sandbox Code Playgroud)
controller.js
var MyController=['$scope','$http','$location',function ($scope, $http, $location) {
//do some fancy stuff
if($scope.myAttribute===undefined){
$scope.myAttribute=someDataFromHttpRequest;
}
$location.search(someParameters);
}];
Run Code Online (Sandbox Code Playgroud)
index.html和host.jsp未显示简洁及其无关紧要.
控制器从Ajax请求中获取一些数据,将其中的一些存储在其中$scope以避免再次请求它并将其显示给用户并等待输入.当用户在视图中选择一些数据时,我更新URL查询部分以反映选择更改.但我想通过检查数据是否可用来避免后续的Ajax请求$scope.
我面临的问题$scope.myAttribute是始终未定义.它会根据每个请求进行重置.我想我在滥用AngularJS.任何线索?
我创建了一个自定义AuthenticationProvider来执行自定义安全检查.我还创建了继承的自定义异常,AccountStatusException以通知用户状态问题,例如用户在特定时间段内未验证其帐户的UserDetails情况.我也是自定义实现.
这是我执行的安全检查的代码.省略了与案例无关的代码.
public class SsoAuthenticationProvider implements AuthenticationProvider {
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
String username = (String) authentication.getPrincipal();
User user = null;
if (username != null) {
user = getUserRepository().findByUserName(username);
if (user != null) {
if (user.getEnabled() != 0) {
if ((user.getUserDetail().getConfirmed() != 0)
|| ((new Date().getTime() - user.getUserDetail().getRequestDate().getTime()) / (1000 * 60 * 60 * 24)) <= getUnconfirmedDays()) {
if (getPasswordEncoder().isPasswordValid(user.getPassword(),
(String) authentication.getCredentials(), user)) {
user.authenticated = true;
user.getAuthorities();
}
} …Run Code Online (Sandbox Code Playgroud) 我有一个运行 wordpress 安装的 docker 镜像。图像由执行 apache 服务器作为默认命令。因此,当您停止 apache 服务时,容器将退出。
问题是在弄乱 apache 服务器配置之后出现的。容器无法启动,我无法恢复图像内容。
我的选择是覆盖容器运行的命令或将上次文件系统更改恢复到以前的状态。
这些事情有可能吗?备择方案?
项目和插槽,其中项目槽中文件的父母:我们有两种类型的弹性搜索(ES)的文档.我们使用以下命令定义索引:
curl -XPOST 'localhost:9200/items' -d @itemsdef.json
Run Code Online (Sandbox Code Playgroud)
哪里itemsdef.json有以下定义
{
"mappings" : {
"item" : {
"properties" : {
"id" : {"type" : "long" },
"name" : {
"type" : "string",
"_analyzer" : "textIndexAnalyzer"
},
"location" : {"type" : "geo_point" },
}
}
},
"settings" : {
"analysis" : {
"analyzer" : {
"activityIndexAnalyzer" : {
"alias" : ["activityQueryAnalyzer"],
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["trim", "lowercase", "asciifolding", "spanish_stop", "spanish_synonym"]
},
"textIndexAnalyzer" : {
"type" : "custom",
"tokenizer" …Run Code Online (Sandbox Code Playgroud)