Javascript Rollover混乱

时间:2015-11-22 01:25:43

标签: javascript html css

您好,我正在尝试为以下代码创建翻转,但似乎无法弄清楚如何执行此操作。

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script type="javascript" src="../javascript/rollover_library.js"></script>
<script>
    var $ = function (id) { return document.getElementById(id); }
    var rollover;
    window.onload = function () {
        rollover1 = new Rollover("image1", "../images/flying_bats.jpg");
        rollover2 = new Rollover("image2", "../images/rat1.jpg");
        rollover3 = new Rollover("image3", "../images/strobe1.jpg");
    }
</script>

以上是javascript。翻转脚本的第二部分实际上做了什么?包含(&#34; image1&#34;,&#34; ../ images / flying_bats.jpg&#34;)的部分?或应该去那里?我认为这就是我搞砸的地方。

<aside class="sidebarR">
    <h1>Customer's who bought this product also bought:</h1>
    <ul>
        <li>
            <figure>
                <img id="image1" src="../thumbnails/flying_bats.jpg" alt="Flying bats" >
                <figcaption><a href="#" class="underConstruct">Flying bats</a></figcaption>
            </figure>
        </li>
        <li>
            <figure>
                <img id="image2" src="../thumbnails/rat1.jpg" alt="16-inch rat" >
                <figcaption><a href="#" class="underConstruct">16" Ugly rat</a></figcaption>    
            </figure>
        </li>
        <li>
            <figure>
                <img id="image3" src="../thumbnails/strobe1.jpg" alt="Mini strobe" >
                <figcaption><a href="#" class="underConstruct">Mini strobe light</a></figcaption>                   
            </figure>
        </li>
    </ul>
  </aside>

0 个答案:

没有答案