0

在我的网站上使用这个脚本。 ,但是因为 jscript 是为列表项 id 设置的,所以我不太确定如何安全地将其更改为 div。

我知道这很简单,所以任何能够指导我的人将不胜感激!

所有代码都在前一页上,高度调整位是这样的:

// Adjust outer wrapper to fit new list snuggly
var newHeight = base.$el.find("#"+listID).height();
$allListWrap.animate({
    height: newHeight
});

我只是将列表项更改为 div 和 ps:

<div class="list-wrap">
        <div id="featured">
            <p>Stuff in here!</p>
        </div>
         <div id="core" class="hide">
            <p>hello</p>
         </div>
         <div id="jquerytuts" class="hide">
            <p>Stuff in here!</p>
         </div>
         <div id="classics" class="hide">
            <p>Stuff in here!</p>
         </div>
         <div id="link" class="hide">
            <p>Stuff in here!</p>
         </div>
</div> <!-- END List Wrap -->

如果有人知道并可以提供帮助,那就太好了..

4

1 回答 1

0
hai now check work correctly.
copy and paste your code and run your system.





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>

             var newHeight = base.$el.find("#"+listID).height();
                $allListWrap.animate({
                    height: newHeight
                });

</script>
<style>
 div p
 {
     margin:0px;
     padding:5px 0px 0px 0px;

 }
</style>
</head>

<body>
<div class="list-wrap">

        <div id="featured">
            <p>Stuff in here!</p>
        </div>

         <div id="core" class="hide">
            <p>hello</p>
         </div>

         <div id="jquerytuts" class="hide">
            <p>Stuff in here!</p>
         </div>

         <div id="classics" class="hide">
            <p>Stuff in here!</p>
         </div>

         <div id="link" class="hide">
            <p>Stuff in here!</p>
         </div>

</div> <!-- END List Wrap -->

</body>
</html>
于 2012-08-08T16:16:07.440 回答