2015-10-24 60 views
0

我需要摆脱底部的整个DIV内容顶部上的负载,30秒后的onload我需要更换#内容框#内容BOX2jQuery的动画效果全格内容

<script type="text/javascript"> 
     $("document").ready(Show_Alert()); 
      function Show_Alert() { 
      $(function(){ 
      $("#content-box").animate({'bottom': 1900},700); 
      }); 
     } 
    </script> 

    <div id = "content-box"> 
     qwerty 
    </div> 

    <div id = "content-box2"> 
     1234567890 
    </div> 
+0

能不能做到,在jQuery的? – vasanth

+0

肯定它可以完成与jquery ..你有什么意义与替换? ...替换职位?它是固定的还是绝对的?或将其替换为html结构..其对我不明确..因此使用[Make Demo](http://jsfiddle.net/) –

+0

div内容应该被替换,qwerty应该替换为1234567890 – vasanth

回答

1

使用该脚本:

$(document).ready(function(){ 
     setTimeout('Show_Alert()', 30000); 
    }); 

    function Show_Alert() { 
     $("#content-box2").animate({'bottom': '1900px'},2000); 
    } 

而这个CSS:

#content-box2 { position: absolute; bottom:0; left:0; width: 100%; } 

如果它不能帮助你请你向我们提供的CSS的内容框,告诉我们究竟应该30秒后发生了什么?

+1

做得好Viktor。非常感谢! – vasanth

1

为你评论说更换.. -in你的病例可以使用.html()

$('#content-box').html($('#content-box2').html()); 

,或者您可以使用.text()

$('#content-box').text($('#content-box2').text()); 
+1

谢谢穆罕默德,我明白了。 – vasanth