我的工作部门没有调整到移动设备的大小

时间:2014-02-21 09:24:32

标签: android jquery css jquery-mobile flip

我使用Quick flip 2创建了一个应用。我想要这个应用程序重新调整大小到移动屏幕。为此,我使用了jquery-mobile

这就是我所做的:

<!--css-->


<style>


.quickFlip, .quickFlip3 {
    height: 350px;
    width: 400px;
}

.quickFlip2 {
   height: 150px;
    width: 40%;
    float: left;
    margin-right: 9%;
}

/* the rest of this is irrelevent */

.clear {
    clear: both;
    magin: 0;
    padding: 0;
}

.redPanel, .blackPanel {
    text-align: center;
}

.half-col {
    width: 50%;
    float: left;
}

/**** panels ****/

.quickFlip, .quickFlip2, .quickFlip3 {
    font-family: "Trebuchet MS", Verdana, Sans-serif, sans;
    font-size: 13px;
    position: relative;
}

.quickFlip .blackPanel, .quickFlip2 .blackPanel, .quickFlip3 .blackPanel {
    background-color: #FFD993;
    color: darkbrown;
    border: 1px outset #A61C14;
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
}

.quickFlip .redPanel, .quickFlip2 .redPanel, .quickFlip3 .redPanel {
    background-color: #75941f;
    color: #FFF;
    border: 1px outset #4f6417;
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
}

.half-col p {
    padding: 5px;
    margin:0 30px 10px 30px;
}

.half-col p.panel-content {
    text-align: left;
    margin-top: 10px;
}

.half-col h3, .half-col h4 {
    padding: 0;
    margin: 0 35px;
}

.half-col h3 {
    text-align: left;
    font-size:24px;
    line-height:24px;
}

.half-col .redPanel h3 {
    text-align: center;
    margin-bottom: 10px;
}

.half-col .first {
    margin-top: 30px;
}

.half-col EM {
    display: block;
    padding: 0;
}

.half-col A.quickFlipCta {
    position: absolute;
    bottom: 30px;
    left: 65px;
    width: 210px;
    font-size: 15px;
    outline: none;
}

.quickFlip2 .redPanel a {
    color: #FFF;
}

.quickFlipCta {
    cursor: pointer;
}
</style>
<!--Javascript-->
<script src="jquery-1.9.1.js"></script>
<script src="jquery.mobile-1.4.1.js"></script>
<script src="jquery.quickflip.source.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
    $('.quickFlip').quickFlip();

    $('.quickFlip3').quickFlip({
        vertical : true
    });

    $('.quickFlip2').quickFlip();
});
</script>

<script>

$(document).ready(function() {
//alert("1");
function getImage(){
    var img = new Image();
    img.src = "apple_transparent.gif"
    img.width = 80;
    img.height=80;

    return img;
}
var rand = Math.floor(Math.random() * 10) + 1,
    imgContainer = $("#imgContainer"),
    i;
//alert(rand);
$("#imgNo").text(rand);

for (i=0; i<rand; i++){
    imgContainer.append(getImage());
}
$('#shownext').click(function(){

   location.reload();
        });
$("#click_flip").click(function(){
//alert("numbers/"+rand+".png");
$("#theImg").remove();
 $('#b').append('<img id="theImg" src="numbers/' + rand + '.png" width="260px" height="260px"/>');

});
});
</script>
</head>
<body>

<div data-role="page">


  <div data-role="main" class="ui-content">
     <div class="quickFlip">
        <div id="imgContainer" class="blackPanel">

            <center><input id="click_flip" type="button" class="quickFlipCta" value="Flip to see the Answer" ></center>




        </div>

        <div id="b" class="redPanel">

            <!-- <h4>A plugin for jQuery</h4>
            <p><em>By Jon Raasch</em></p> -->
                   <center> <input id="flip_again" class="first quickFlipCta" type="button" value="Flip Again" ></center>
                  <center> <input id="shownext" type="button" value="Show Next" ></center>
        </div>
    </div>

  </div>

  </div> 

但这不起作用。我应该做些什么改变才能使它发挥作用?

页面div正在调整大小,但我的div类QuickFlip是我的工作div没有调整大小

1 个答案:

答案 0 :(得分:0)

.cendiv{
  background: #e5e5e5;
  bottom: 0;
  height: 80%;
  left: 0;
  margin: auto;
  position: absolute;
  top: 0;
  right: 0;
  width: 98%;
}