新足迹

 找回密码
 注册

精华好帖回顾

· 夏季转会展望之二 (2008-5-25) joaquin · 新衣服们,108楼加网址,116真人23日加新。。 (2008-10-20) wellye
· 遥想去年此时 (2005-6-28) luxixi · 澳洲数学教育思路 (2008-10-17) 第一名
Advertisement
Advertisement
查看: 1563|回复: 8

面试碰到的一道题不知如何做 [复制链接]

发表于 2011-1-22 16:09 |显示全部楼层
此文章由 footstep123 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 footstep123 所有!转贴必须注明作者、出处和本声明,并保持内容完整
昨天,收到面试的题目,其中的一道题是关于JavaScript的 hover states, 在一个网页中,有网页图片,当hover 图片时, 网页的lastest  new 中的链接也显示 手型图标.
on-hover transitioned fade-in of portfolio images using JavaScript (libraries allowed) + hover states on links as depicted in attached,,
自己找了没有找到如何解答,请大家给个建议,等待中,我在继续解答,谢谢大家帮助。

[ 本帖最后由 footstep123 于 2011-1-22 17:11 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
Advertisement
Advertisement

发表于 2011-1-22 16:24 |显示全部楼层
此文章由 featheast 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 featheast 所有!转贴必须注明作者、出处和本声明,并保持内容完整
不理解题目阿,为什么会同时有两个手形出现呢

发表于 2011-1-22 17:49 |显示全部楼层
此文章由 alee79 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 alee79 所有!转贴必须注明作者、出处和本声明,并保持内容完整
第二个手可以是图片嘛

发表于 2011-1-22 18:52 |显示全部楼层
此文章由 乱码 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 乱码 所有!转贴必须注明作者、出处和本声明,并保持内容完整
check it out.

http://forums.asp.net/p/1495100/3523481.aspx

http://www.sohtanaka.com/web-des ... er-effect-w-jquery/

[ 本帖最后由 乱码 于 2011-1-22 20:00 编辑 ]

发表于 2011-1-22 19:57 |显示全部楼层
此文章由 footstep123 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 footstep123 所有!转贴必须注明作者、出处和本声明,并保持内容完整
谢谢回复,我在探索中,希望从你们的提示中得到答案。

发表于 2011-1-22 20:14 |显示全部楼层
此文章由 dover 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 dover 所有!转贴必须注明作者、出处和本声明,并保持内容完整
只要是联结都会出现“手”,  <a href=""....就行了。
Advertisement
Advertisement

发表于 2011-1-22 21:43 |显示全部楼层
此文章由 footstep123 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 footstep123 所有!转贴必须注明作者、出处和本声明,并保持内容完整
我想可能也是我理解错误了,他给我的题目可能就是当点击hover latest news 时,对应的图片由不清晰的状态,变成清晰的状态,为了说明清楚题目在 图片上也画了 一个手型的标志,所以才会出现 两个手型的图标, 我原来的理解是如何通过 JavaScript 当hover 时,使 图片也会有手型的图标同时图片由不清楚变成清楚的状态。不知我目前的理解是否准确?
题目写的“
Exercisedescription
Find attached a layout (including hover state depiction) that we would like youto produce using XHTML / CSS / Javascript.

Exercise deliverables
XHTML file(s)
CSS file(s)
JS file(s)
Image(s)

Characteristics
- on-hover transitioned fade-in of portfolio images using JavaScript(libraries allowed) + hover states on links as depicted in attached
- XHTML 1.0 document type
- separate structure (XHTML) from style (CSS)
- semantic

W3Cmarkup


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

发表于 2011-1-23 11:30 |显示全部楼层
此文章由 footstep123 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 footstep123 所有!转贴必须注明作者、出处和本声明,并保持内容完整
根据大家的提示我知道如何来实现,当mouseover 可以出现2个手型图标,只是另一个手型图标是通过显示的图片,通过JavaScript来实现图片的显示和隐藏。我贴出来整个的html页面包括Javascript+css.
<!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>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>testproject</title>
  <!-- import css stylesheet -->
  <!--link type="text/css" rel="stylesheet" href='css/maincss.css' /-->
  <style type='text/css'>
    body{
      /*define font style*/
      font-family:verdana,arial,helvetica; color:#fff;
      /*background */
      background:#000 ;
      }
      /*define all part, alignment in center*/
      #all {
        width:900px;
        margin:0px  auto;
        /*border:1px #f00 solid;*/
      }
      /*menu and banner*/
      #head{
        height:296px;
      }
      
      /*define menu*/
      #headtop{
        height:56px;
        background-color:#4A4642;
      }
      /*banner*/
      #headbottom{
        height:240px;
        /*define backgroud color, except banner color*/
        background-color:#24a1c1;
      }
      /* center include 4 pictures, leftside has 2 picts, right side has 2 picts */
      #center {
        height:130px;
        background-color:#fefefe;
        /*move left right float */
        clear:both;
      }
      /* left side, leftside has 2 picts*/
      #center #centerleft{
        width:49% ;
        float:left;
        margin-top:6px;
      }
      /*right side, right side has 2 picts*/
      #center #centerright{
        width:49% ;
        float:right;
        margin-top:6px;
      }
      
      #img01{
        float:left;
        margin-left:20px;
        width:162px;
        /*clear left float*/
        clear:left;
        /*for ie fadein and fadeout */
         filter: alpha(opacity=70); /* MSIE */
        
      }
      
      
      #img02{
        float:right;
        width:162px;
        margin-right:15px;
        /*for ie fadein and fadeout */
         filter: alpha(opacity=70); /* MSIE */
        /*clear:left; */
      }
      #img03{
        
        float:left;
         margin-left:15px;
        width:162px;
        /*for ie fadein and fadeout */
         filter: alpha(opacity=70); /* MSIE */
      }
      #img04{
         float:right;
         margin-right:20px;
         width:162px;
         /*clear right float*/
         clear:right;
         /*for ie fadein and fadeout */
          filter: alpha(opacity=70); /* MSIE */
         
      }
      
      
      /*define bottom, has 2 columns*/
      #bottom{
        color:#99938b;
        /*define font size */
        font-size:6pt;
        height:474px;
        background-color:#f8f2e7;
        /*clear right and left float*/
        clear:both;
      }
      /*define left side 1 column*/
      #bottomleft{
        float:left;
        width:231px;
        background-color:#eee7dd;
        margin-top:25px;
        margin-left:18px;
        /*padding:5px 10px;*/
      }
      /*define right side 1 column*/
      #bottomright{
        float:right;
        width:581px;
        background-color:#eee7dd;
        margin-right:20px;
        margin-top:25px;
        /*padding:5px 10px;*/
      }
      /*define colmn margin*/
      #innerleft, #innerright{
        /*define the margin left-right and top-bottom*/
        margin:5px 15px;
      }
      /*clear list style, move to right*/
      ul {
          margin-top:0px;
          margin-left:600px;
         
          list-style-type:none;
          display:inline;
          }
      /*define link lvha style*/   
      ul  a:link{color:#ffffff;text-decoration:none;}
      ul a:visited{color:#99CC33;text-decoration:none;}
      ul a:hover{color:#8C8C8C;text-decoration:underline}
      ul a:active{color:#8c8c8c; text-decoration:none;}
      
      /*define li horizonal alignment*/
      li {
        float:right;
      
        font-size:10pt;
        margin:20px 10px;
        
       }
      
      #imgp01{
         margin-top:-14px;
         margin-left:80px;
        
      }
      #imgp02{
         margin-top:-14px;
         margin-left:80px;
        }
      #imgp03{
         margin-top:-14px;
         margin-left:80px;
        }
      #imgp04{
         margin-top:-14px;
         margin-left:80px;
        }
         

  </style>
  <!-- define javascript in main.js file-->
  <!--script type="text/javascript" src='js/main.js' -->
  <!--/script-->
  <script type='text/javascript'>
  
       //when window onload run init()
       window.onload=function(){
         init();
       }
       //make pictures fadeout and make hand icon  disappear.
       function init(){
          //alert("fine1");
          var i=1;
          var picts=4;
          //make handicon no display;
          for (i=1;i<=picts;i++){
            //get handicon object
            d=document.getElementById("imgp0"+i);
            d.style.display="none";
          }
            //init fadegegree 0.7
            fadedegree1=0.7;
            
            //make fadeout, how many picts  
            for (i=1;i<=picts ;i++)
            { //get picture object.
              imgp=document.getElementById('img0'+i);
               //ie browser
               /* if (navigator.appName.indexOf("Microsoft")>=0)
          {pictobj.filters.alpha.opacity=showstart*fadedegree1*100; } */
              if (navigator.appName.indexOf("Microsoft")>=0)
                { //alert("fine1");
                imgp.filters.alpha.opacity=1*fadedegree1*100; }
              else //other browser.  
               {//more and more fade out.
                 imgp.style.opacity=1*fadedegree1;
                }
             }
             //alert("fine");
       }
      //when mouseover link, then make handicon display and make picture fadein very clear.
      function fadeclear(pic){
         //frist make all init status.
         init();
         
         pict="imgp0"+pic;
         //get handicon object.
         img=document.getElementById(pict);
         img.style.display='block';
         fadedegree1=1;
         img=document.getElementById('img0'+pic);
          //to ie
          if (navigator.appName.indexOf("Microsoft")>=0)
            {img.filters.alpha.opacity=1*fadedegree1*100; }
          else //other browser.
           {//more and more fade out.
             img.style.opacity=1*fadedegree1;
            }
      }
      
  </script>
  </head>
  <!--body onload='init();'-->
   <body >
     <div id="all">
     <!-- head part, include menu,banner-->
        <div id="head">
          <div id="headtop">
            <ul>
              <li><a href="#">contact</a></li>
              <li><a href="#">portfolio</a></li>
              <li><a href="#">about</a></li>
            </ul>
          </div>
          <div id="headbottom">
            <img src='img/logo.png' alt='logo' title='logo' height='225' width='900' >
            
          </div>
        </div>
        <!-- center part include 4 pictures and left side has 2 picts and right side has 2 picts-->
        <div id="center">
          <div id="centerleft">
         
            <div id='img01'>
              <img id="m01" src='img/img01.jpg' width='162' height='114' alt='img01' >
              <div id='imgp01'>
                <img src='img/handicon.png'  alt='handicon' >
              </div>
            </div>
            <div id='img02'>
              <img id="m02" src='img/img02.jpg' width='162' height='114' alt='img02' >
              <div id='imgp02'>
                <img src='img/handicon.png' alt='handicon' >
              </div>
            </div>
          </div>
          <div id="centerright">
         
             <div id='img03'>
                <img id="m03" src='img/img03.jpg' width='162' height='114' alt='img03' >
                <div id='imgp03'>
                 <img src='img/handicon.png' alt='handicon' >
               </div>
            </div>
            <div id='img04' >
              <img id="m04" src='img/img04.jpg' width='162' height='114' alt='img04' title='img04' >
               <div id='imgp04'>
                <img src='img/handicon.png' alt='handicon' >
              </div>
            </div>
          </div>
        </div>
        <!-- bottom part, include left column and right column-->
        <div id="bottom">
          <div id="bottomleft">
         
            <img src='img/latestnews.png' alt='latestnews' >
            <div id="innerleft">  
                <p>These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. </p>
                <a href='#1' onmouseover='fadeclear("1");' onmouseout='init();'>read more</a>
                <p> These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. </p>
                <a href='#1' onmouseover='fadeclear("2");' onmouseout='init();'>read more</a>
                <p> These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax.  </p>
                <a href='#1' onmouseover='fadeclear("3");' onmouseout='init();'>read more</a>
                 <p> These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax.  </p>
                <a href='#1' onmouseover='fadeclear("4");' onmouseout='init();'>read more</a>
            </div>
           </div>
          <div id="bottomright">  
             <img src='img/welcome.png' alt='welcome'>
             <div id="innerright">
                 <p>These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. Each of these CSS Tutorials is accompanied with the applicable CSS code and how that code looks when integrated in HTML. </p>
                <p>These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. Each of these CSS Tutorials is accompanied with the applicable CSS code and how that code looks when integrated in HTML. </p>
                 <p>These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. Each of these CSS Tutorials is accompanied with the applicable CSS code and how that code looks when integrated in HTML. </p>
                 <p>These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. Each of these CSS Tutorials is accompanied with the applicable CSS code and how that code looks when integrated in HTML. </p>
                <p>These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. Each of these CSS Tutorials is accompanied with the applicable CSS code and how that code looks when integrated in HTML. </p>
                 <p>These 11 short CSS Tutorials at Louisiana State University give a quick overview with code on how CSS works in tandem with HTML in web pages that are easy to create and load. These primarily cover Borders, Lists, Margins, Fonts and Tables and their respective syntax. Each of these CSS Tutorials is accompanied with the applicable CSS code and how that code looks when integrated in HTML. </p>
                 </div>
          </div>
        </div>
     
     </div>
     
   
  </body>
</html>


用到的几个图片



[ 本帖最后由 footstep123 于 2011-1-24 20:43 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

发表于 2011-1-23 11:43 |显示全部楼层
此文章由 footstep123 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 footstep123 所有!转贴必须注明作者、出处和本声明,并保持内容完整
最后的显示结果

谢谢大家的帮助,我会继续努力学习Web program 并且找到满意工作,希望大家都有满意的工作。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

评分

参与人数 1积分 +3 收起 理由
乱码 + 3 well done!!!

查看全部评分

发表回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Advertisement
Advertisement
返回顶部