2

我明天有一个作业要交。我被困在特定的要求上。我需要做一个 java 脚本图像翻转我是我的 HTML 使用单独的脚本页面。然后将页面链接到 Html Head 标签。

这是我的java脚本页面,而不是我使用标签中的函数,但它仍然没有调用它..有什么建议吗?

这是 javascript 文件:

// Pre load images for rollover
function imgOver() 
{
    document.getElementById('logo').src="images/logo1.jpeg"; 
}

function imgOut() 
{
    document.getElementById('logo').src="images/logo.jpeg"; 
}

onclick=”window.print( ); return false;”

这是 HTML:

<!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" xml:lang="en" lang="en">
    <head>
        <meta name="author" content="Teancum Clark" />
        <meta name="class" content="INFO 2450 - Web Content Design" />
        <meta name="section" content="001" />
        <meta name="project" content="expresswebpractice2a" />
        <meta name="due_date" content="11/07/2012" />
        <meta name="instructor" content="Kim Bartholomew" />
        <meta name="description" content="Description of the project here..." />
        <meta name="keywords" content="expweb2a" />
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <title>Home</title>
        <link href="mystyles.css" rel="stylesheet" type="text/css" />




            <script type="text/javascript" src="MyScript.js"></script>



    </head>

    <body>
        <div class="fl" id="wrapper">
            <div class="fl" id="content">
                <div class="fl" id="header">
                    <div class="fl" id="leftImage">
                        <a href="#" onmouseover="imgOver();" onmouseout="imgOut()">
                        <img id="logo" alt="logo" height="150" src="images/logo1.jpeg" width="110" />
                        </a>

                    </div>
                    <div class="fl" id="rightImage">
                        <img class="rightImage"src="Images/banner.png" alt="Pets R Us banner"/>
                    </div>
                </div> <!--header-->

                <div class="fl" id="left">
                    <a class="buttons fl" href="index.htm">Home</a>
                    <a class="buttons fl" href="AboutUs.htm">About</a>
                    <a class="buttons fl" href="Tributes.htm">Tributes</a>
                </div><!--left-->


                <div class="fl" id="right">
                    right
                </div><!--right-->

                <div class="fl" id="footer">
                    The great Pets R Us staff came and picked her up two hours later and I didn't even have to worry about feeding or watering "Sophie".
                    We now have a regular appointment every Saturday...
                    <br/>
                    <br/>
                    Yours, 
                    <br/>
                    Jewel Anderson, 
                    <br/>
                    Centerville, UT
                    <br/>
                    <a class="buttons fl" href="Tribute.htm">Read More?</a>     

                        <img class="center" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" />
                </div><!--footer-->

            <br style="clear:both; font-size:1px;" />
            </div><!--content-->
        </div><!--wrapper-->
    </body>
</html>
4

2 回答 2

0
onclick=”window.print( ); return false;”

该行是非法的,并导致您的脚本文件被忽略,删除它,您的鼠标悬停/移出将开始工作

于 2012-12-01T06:02:01.870 回答
0
于 2012-12-01T06:09:10.510 回答