我们有这个小组项目,我被指派做一个iframe可调整大小.自上周以来,我一直在阅读很多论坛帖子,我发现iframe自己无法调整大小.
有没有办法让我的iframe可调整大小?
在这个插件中,我有一个带有可拖动标题栏的Angular UI模式.拖动条形图时,整个模态会移动.问题是,如果我相对快速地上下移动鼠标,光标会失去对条的焦点,模态会停止移动.任何想法如何解决这一问题?任何其他方法也欢迎.
HTML
<body ng-app="app" ng-controller="ctl">
<script type="text/ng-template" id="myModalContent.html">
<div class="topbar">This is the title</div>
<div class="modal-header">
<h3 class="modal-title" id="modal-title">I'm a modal!</h3>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
</div>
</script>
<button type="button" class="btn btn-default" ng-click="open()">Open me!</button>
</body>
Run Code Online (Sandbox Code Playgroud)
使用Javascript
var app = angular.module("app", ['ui.bootstrap']);
app.controller("ctl", function($scope,$uibModal,$timeout) {
var modalInstance;
$scope.open = function () {
modalInstance = $uibModal.open({
animation: false,
windowClass: 'the-modal',
templateUrl: 'myModalContent.html'
});
$timeout(function(){
$('.modal-content').draggable({
drag: function( event, ui ) {
if(event.toElement.className.indexOf("topbar") == -1 ) return false; …Run Code Online (Sandbox Code Playgroud) jquery-ui jquery-ui-draggable angularjs angular-ui angular-ui-bootstrap