如何使用jQuery动态地拆分页面?

我的任务是通过分割屏幕来将内容动态地插入到网页中,但我不知道从什么地方开始,因为我以为这是jQuery的一种形式,但是整个页面需要拆分并且内容会相应地移动。

*******************************
*                             *
* THIS IS                     *
* MY WEBPAGE                  *
*                             *
*******************************

我的网页:

*******************************
*                             *
* THIS IS                     *
*                             *
* Inserted content here       *
*                             *
* MY WEBPAGE                  *
*                             *
*******************************

中断下方的内容将随之下降,这是非常繁重的工作。

You have to insert a div withn your page with an id such as:

<div id="content">Hello World</div>

As the page loads, jQuery can hide the content with

$('#content').hide();

Doing it that way makes it possible to see the content if javascript isn't enabled. Then you need a click function to show the content:

$("#show").click(function(){
    $("content").show();
});

I don't know exactly what you want to do, but you should consult the jQuery documentation: http://api.jquery.com/hide/.

This sounds like you need a simple collapsible panel. There are a lot of them available. I like Darren's.

An even more basic approach is to have an empty div which you can load html into it using jQuery. When the div's html is loaded everything below it will automatically move down.

you can make attempt using a sngle div for your webpage and then positioning it as required.

I realize this is an old question, but you could try jQuery Simple Collapsible Panel Plugin.