0

ここのサイトでこのスクリプト を使用しています。ですが、リスト アイテム ID 用に jscript が設定されているため、それを安全に 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 に答える