Javascript iphone浏览器上的以下代码有什么问题?
我使用jQueryCollapse插件来显示问题和答案。 问题写在标签上,答案在我们点击标签时显示。 当选项卡处于活动状态时,表示此时显示答案时页面高度增加,因此我必须增加背景图像的高度。 为此,我编写了如下代码:Javascript iphone浏览器上的以下代码有什么问题?,javascript,jquery,html,css,background-image,Javascript,Jquery,Html,Css,Background Image,我使用jQueryCollapse插件来显示问题和答案。 问题写在标签上,答案在我们点击标签时显示。 当选项卡处于活动状态时,表示此时显示答案时页面高度增加,因此我必须增加背景图像的高度。 为此,我编写了如下代码: <script type="text/javascript"> $(document).ready(function(){ $('#main-content1').height(1450); $("#t1").click(function(){
<script type="text/javascript">
$(document).ready(function(){
$('#main-content1').height(1450);
$("#t1").click(function(){
var height = 1450;
$('#main-content1').height(height);
});
$("#t2").click(function(){
var height = 1450;
$('#main-content1').height(height);
});
$("#t3").click(function(){
var height = 1275;
$('#main-content1').height(height);
});
$("#t4").click(function(){
var height = 1250;
$('#main-content1').height(height);
});
</script>
#main-content1 {
margin-left:auto;
margin-right:auto;
margin-top:35px;
width:900px;
border-top-left-radius:48px;
border-top-right-radius:48px;
border-bottom-left-radius:48px;
border-bottom-right-radius:48px;
padding-bottom:20px;
height:1450px;
background:url(res/back-img.png) repeat;
}
#footer {
border-top: 0px solid #003366;
overflow:visible;
}
.foot {
float:left;
list-style-type:none;
margin-bottom:20px;
background-image:url(res/footer_back.png);
background-repeat:no-repeat;
overflow:visible;
margin-top:-50px;
background-position:0px 120px;
width:182px;
height:180px;
}
img {
border-color:transparent;
}
#site-footer {
width:728px;
margin-left:auto;
margin-right:auto;
}
页脚的代码如下所示:
<script type="text/javascript">
$(document).ready(function(){
$('#main-content1').height(1450);
$("#t1").click(function(){
var height = 1450;
$('#main-content1').height(height);
});
$("#t2").click(function(){
var height = 1450;
$('#main-content1').height(height);
});
$("#t3").click(function(){
var height = 1275;
$('#main-content1').height(height);
});
$("#t4").click(function(){
var height = 1250;
$('#main-content1').height(height);
});
</script>
#main-content1 {
margin-left:auto;
margin-right:auto;
margin-top:35px;
width:900px;
border-top-left-radius:48px;
border-top-right-radius:48px;
border-bottom-left-radius:48px;
border-bottom-right-radius:48px;
padding-bottom:20px;
height:1450px;
background:url(res/back-img.png) repeat;
}
#footer {
border-top: 0px solid #003366;
overflow:visible;
}
.foot {
float:left;
list-style-type:none;
margin-bottom:20px;
background-image:url(res/footer_back.png);
background-repeat:no-repeat;
overflow:visible;
margin-top:-50px;
background-position:0px 120px;
width:182px;
height:180px;
}
img {
border-color:transparent;
}
#site-footer {
width:728px;
margin-left:auto;
margin-right:auto;
}
当我点击标签时,它会显示答案,但不会按照iphone手机浏览器上的jquery代码增加其背景图像高度。但它在windows pc浏览器上运行良好。
内容在页脚后面。
我非常喜欢谷歌,但我不知道如何解决这个问题。
请任何人帮我解决这个问题。
提前感谢。尚未测试,但请尝试“最大高度”,而不是“高度/或自动高度” CSS
同时添加
footer
css这似乎是一个结构性问题?需要你的css。@Morpheus:我也添加了页脚css代码。.那行是宽度:900px*/代码>只是输入错误?可能值得添加一个关于您正在使用的特定浏览器版本的注释。您使用的是哪个iOS版本?哪种电脑浏览器/版本?您是否尝试过其他PC(或移动)浏览器?