小编Shr*_*uti的帖子

如何使用angular ui bootstrap在pop上显示html?

我做了这样的弹出演示.当我点击按钮时,它会在右侧显示一个弹出窗口.但现在问题是我将如何在弹出时显示一些html.

<html ng-app="plunker">

  <head>
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  </head>

  <body>
    <button popover-placement="right" popover="On the Right!" class="btn btn-default">Right</button>
  </body>
<script>
angular.module('plunker', ['ui.bootstrap']);

</script>  

</html>
Run Code Online (Sandbox Code Playgroud)

我有这个HTML我需要如何在pop上添加这个.我知道在bootrap.js中有方法在popover上添加html.我不想使用我想要使用angular UI bootrap.js

<div ng-controller="axcont">
<ul class="list-group">
  <li class="list-group-item" ng-click="add()">add row</li>
  <li class="list-group-item " ng-click="deleteRow($index)">Deleterow</li>

</ul>
</div>
Run Code Online (Sandbox Code Playgroud)

我做了更多尝试,但得到了未定义.可能我错了我只是在做RND

<html ng-app="plunker">

  <head>
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/>
  </head>

  <body>
    <button pop-over title="Mode of transport" content-url="pop.html" class="btn btn-default">Right</button>
  </body>
<script>
var a=angular.module('plunker', ['ui.bootstrap']);
a.directive('popOver', function ($compile, $http, $templateCache) {
  return …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angular-ui angularjs-directive angular-ui-bootstrap

15
推荐指数
1
解决办法
1万
查看次数

按下输入时如何将焦点移动到下一个字段?

你可以告诉我当按下回车键时如何将焦点转移到下一个字段?我使用dform插件(将JSON转换为表单).

我用Google搜索,但这不起作用.为什么我的重点不转移到下一个领域?

JSFiddle:http://jsfiddle.net/5WkVW/1/

$(document).keypress(function(e) {
        if(e.which == 13) {
    
                // Do something here if the popup is open
                alert("dd")
                var index = $('.ui-dform-text').index(this) + 1;
                $('.ui-dform-text').eq(index).focus();
            
        }
    });
Run Code Online (Sandbox Code Playgroud)

*注意(来自评论):它还需要处理没有tabindex设置值的页面

javascript jquery jquery-mobile

14
推荐指数
2
解决办法
6万
查看次数

如何在角度js中获得长按事件?

我试图在角度js中获得长按事件.我从这里找到了解决方案 https://gist.github.com/BobNisco/9885852 但是我无法登录控制台.我的代码是. http://goo.gl/ZpDeFz 你能不能告诉我哪里出错了..

$scope.itemOnLongPress = function(id) {
    console.log('Long press');
}

$scope.itemOnTouchEnd = function(id) {
    console.log('Touch end');
}
Run Code Online (Sandbox Code Playgroud)

javascript jquery angularjs angularjs-directive angularjs-scope

9
推荐指数
2
解决办法
1万
查看次数

如何在AngularJS中向上滑动和向下滑动?

我想在AngularJS中做一个简单的切换示例.我面临一个问题,我需要显示和隐藏一些动画,如向上滑动和向下滑动.我search点击标题上的按钮我显示搜索div它在我的plunker工作.我的问题是做动画......

其次我需要添加,z-index因为它会生成新图层.当我点击搜索按钮时,"我的名字" 会在搜索栏打开时关闭.为什么?

<ion-view>
<ion-header-bar align-title="" class="bar-positive">
  <div class="buttons">
  <i style="font-size:25px!important" class="icon-right ion-android-radio-button-off" ng-click="showsearch()"></i>

  </div>
  <h1 class="title">Title!</h1>
  <a class="button icon-right ion-chevron-right button-calm"></a>
</ion-header-bar>
<div class="list list-inset searchclass" ng-show="isdiplay">
  <label class="item item-input">
    <img src="https://dl.dropboxusercontent.com/s/n2s5u9eifp3y2rz/search_icon.png?dl=0">
    <input type="text" placeholder="Search">
  </label>
</div>
<ion-contend>
  <div style="margin-top:50px">
  my name
</div>
</ion-contend>

</ion-view>
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-directive angularjs-scope angularjs-ng-repeat ionic-framework

6
推荐指数
1
解决办法
1万
查看次数

如何从sqlite Phonegap中的表中获取值

我正在使用Phonegap sqlite.

我的数据库中有一个名为"Phone"的表,其中我有3列.

表结构是:

ID     PhoneName  Version
1       A          1.3
2       B           3.4
Run Code Online (Sandbox Code Playgroud)

我得到了ID的价值.

如何从表中检索PhoneName的值?

sqlite cordova

5
推荐指数
1
解决办法
1万
查看次数

如何使用角度js滚动div的底部

我有一个div我在其中添加了元素.我想在div中添加元素时滚动到div的底部.我知道如何在jquery中执行.但我不知道如何使用jquery Scroll使用angular js 滚动div的底部?

testCaseContainer是div的id.

var elem = document.getElementById('testCaseContainer'); // just to
                                                                    // scroll down
                                                                    // the line
        elem.scrollTop = elem.scrollHeight;
Run Code Online (Sandbox Code Playgroud)

我想知道如何使用角度?

http://plnkr.co/edit/M8tCL8Szc3h3FatFLycG?p=preview

我在div容器中添加了css以便滚动.

.heightClass{
  height:100px;
  overflow :auto;
}
Run Code Online (Sandbox Code Playgroud)

如何在添加项目时将焦点移动到下方..请发布您的答案..

javascript jquery angularjs angularjs-directive

5
推荐指数
1
解决办法
1万
查看次数

如何使用角度js验证离子形式

我试图使用带角度的离子框架.我想在按钮click.Mean上验证我的表单.我需要在按钮点击时验证所有字段.所有字段都是必需的..我需要显示一个错误消息,如果一个字段不符合要求.像密码最小字符5和最大10.和电子邮件验证.

你能告诉我将如何进行验证.这是我的代码

<html ng-app="">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <title>Sign-in, Then Tabs Example</title>

    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>

  </head>

  <body>

    <ion-view title="Page">
    <ion-content padding="true" class="has-header has-footer">
        <form>
            <label class="item item-input">
                <span class="input-label">name</span>
                <input type="text" placeholder="name">
            </label>
            <label class="item item-input">
                <span class="input-label">email</span>
                <input type="email" placeholder="email">
            </label>
            <label class="item item-input">
                <span class="input-label">password</span>
                <input type="password" placeholder="password">
            </label>
        </form>
        <button class="button button-balanced button-block">check validation</button>
    </ion-content>
</ion-view>

  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-directive angularjs-scope ionic-framework

5
推荐指数
1
解决办法
2万
查看次数

当用户在角度js中滚动到顶部时如何获取事件?

你可以告诉我当用户滚动到顶部时如何获取事件.实际上我在我的例子中使用ng-repeat.我想在用户滚动到底部并滚动到顶部时获取事件.我有一个div我在其中使用ng -repeat可以在滚动后用户移动到顶部时获得顶级事件.实际上我需要在用户滚动到角度的div底部和顶部时显示警告.这是我的代码

<body ng-controller="MyController">
<div style="width:90%;height:150px;border:1px solid red;overflow:auto">
<div ng-repeat="n in name">{{n.name}}</div>
</div>
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-directive angularjs-scope angularjs-ng-repeat angular-ui-router

3
推荐指数
1
解决办法
5063
查看次数

为什么定制放在一边或滑动面板不使用角带滑动?

我正在制作一个幻灯片.所以我用Google搜索并发现了一个纠结的书库.我研究那个图书馆试图制作幻灯片. http://mgcrea.github.io/angular-strap/##asides.我导入了所有必需的js,但是我的侧面板没有像现场那样滑动.我不知道我错在哪里.这是我的代码与plunker. http://plnkr.co/edit/GIFyFSdyJI8tHq5nlBBn?p=preview

<!DOCTYPE html>
<html ng-app="myApp">

<head>
  <link data-require="bootstrap-css@3.x" data-semver="3.2.0" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
  <script data-require="jquery@2.1.1" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

  <script data-require="angular.js@*" data-semver="1.3.0-beta.5" src="https://code.angularjs.org/1.3.0-beta.5/angular.js"></script>
  <script data-require="ui-bootstrap@0.10.0" data-semver="0.10.0" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.10.0.js"></script>
  <link rel="stylesheet" href="style.css" />
  <script src="script.js"></script>
  <script src="https://dl.dropboxusercontent.com/s/64qidru3z31h5ns/angular-strap.js"></script>
  <script src="https://dl.dropboxusercontent.com/s/meplmw59rwg2dmy/angular-strap.tpl.js?m=d"></script>
  <script src="https://dl.dropboxusercontent.com/s/8km0nfoc9noz9ns/modal.js?m="></script>
  <script src="https://dl.dropboxusercontent.com/s/40vdgl5hglimwfi/aside.js?m="></script>



</head>

<body class="container">
  <button type="button" class="btn btn-lg btn-danger" data-template="aside.html" data-placement="left" data-animation="am-slide-left" bs-aside="aside" data-container="body">Custom aside
  <br>
  <small>(using data-template)</small>
</button>
  <script>
    var myapp = angular.module('myApp', ['mgcrea.ngStrap','mgcrea.ngStrap.modal', 'mgcrea.ngStrap.aside']);
  </script>
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

javascript jquery angularjs angularjs-directive angular-strap

2
推荐指数
1
解决办法
3046
查看次数

如何检查元素是否有类?已经使用(hasClass方法)?

我有这个HTML或标记.

<fieldset class="ui-dform-fieldset">
    <input type="text" id="totalRetryCount" name="totalRetryCount" tabindex="1" onblur="validateElement('Configuration', 'testSuiteConfigurationform','totalRetryCount')" class="ui-dform-text">
    <legend class="ui-dform-legend">Total Retry Count</legend>
    <label for="totalRetryCount" class="error">Please enter a valid number.</label>
</fieldset>
Run Code Online (Sandbox Code Playgroud)

我想检查标签是否有错误类.我确实喜欢这样

当我调试我的元素值是"totalRetryCount".但它没有显示警报.

element ="totalRetryCount"

if($("#"+element+" "+"label").hasClass('error')){
        alert('-sdafs-')
    }
Run Code Online (Sandbox Code Playgroud)

javascript jquery

0
推荐指数
1
解决办法
440
查看次数

如何在jQuery mobile中降低面板的高度

我在jQm中制作了一个面板.我想降低面板的高度.我添加了高度属性但重要但它不起作用.我也谷歌它没有找到任何解决方案你能告诉我如何降低面板的高度.

这里是小提琴 http://jsfiddle.net/7Cmb3/8/

#mypanel{

    height:100px !important
}
Run Code Online (Sandbox Code Playgroud)

谢谢

javascript jquery jquery-mobile

0
推荐指数
1
解决办法
850
查看次数

为什么浮动权不起作用也使用重要?

我的标题中有三个图像按钮,位于右侧,如图所示,我试图在标题上添加三个按钮。但它没有采用浮动:右侧边距右侧。我需要这样做,请检查图像![在此处输入图像描述][1]

我在右侧有 “+”和搜索和漏斗图像。所以要在右侧制作这个按钮?这是我的plunker

<ion-header-bar align-title="" class="bar-balanced">
  <a class="button button-clear  icon-right ion-chevron-right ">
  </a>

  <h1 class="title">Title!</h1>
  <div style="float:right!important;border:1px solid red ;margin-right:10px">
  <a class="button button-icon icon ion-plus"></a>
  <a class="button button-icon icon ion-search"></a>
  <a class="button button-icon icon ion-funnel"></a>
  </div>

</ion-header-bar>
Run Code Online (Sandbox Code Playgroud)

javascript css angularjs angularjs-directive ionic-framework

0
推荐指数
1
解决办法
626
查看次数