在我的项目中,我在初始页面中有一段代码:
html
<div id="box">
<div id="header"> <span id="title"></span> <span id="button">X</span> </div>
<div id="text"> </div>
</div>css
#box {
border-style: solid;
box-shadow: 2px 2px 2px black;
max-width: 66%;
max-height: 80%;
}
#button {
background-color: #99CCFF;
min-width: 32px;
max-width: 5%;
min-height: 32px;
max-height: 100%;
position:absolute;
right:0px;
text-align:center;
padding-left:10px;
padding-right:10px;
}
#header {
background-color: #66B2FF;
}
#title {
text-decoration-color: #FFFFFF;
font: 28px arial;
}
#text {
background-color: #E0E0E0;
text-decoration-color: #000000;
font: 24px sans-serif;
overflow: scroll;
}我使用jquery中的尊重函数将这个元素定义为可拖动和可调整大小。拖曳行为是完美的,但调整不了。
这是jquery代码来调整这一点:
$('document').ready(function(){
$('#box').draggable({
cointainment: "#container"
});
$('#box').resizable({
cointainment: "#container"
});
$('#box').hide();
$('#button').click(function(){
$('#box').hide();
});
$('a').click(function(e){
if($(this).attr('href') != 'logout.html') {
e.preventDefault();
$.get($(this).attr('href'), function(data){
var $temp = $('<div/>', {html:data});
$('#title').text($temp.find('title').text());
$('#text').html($temp.remove('head').html());
$('#box').show();
});
}
});
});有人能看到代码中的错误吗?
另外,我有一个关于css显示的问题。如何看到,我定义了最大宽度和最大高度;它发生的最大高度属性不起作用。有人能看出是怎么回事吗?
https://stackoverflow.com/questions/22548303
复制相似问题