当查看DIV时,我将如何编写一个脚本来控制页面的各个方面?

| 因此,我在roseannebarr.tumblr.com上有一个丑陋的,预先设计的轮播,我打算用专用的“关于”按钮将DIV放置在轮播的左侧。当单击“关于”按钮时,我希望在其位置显示一个“向左”箭头。我会使用if else语句吗?我没有Java经验,但是我正在学习。任何帮助表示赞赏。     
已邀请:
        您不能仅使用javascript函数将div这样放置吗? 基本上,您将div放在轮播上。该dis的跨度为About,可单击。如果单击,它将调用js函数。 然后,js函数在跨度内放置一个新图像。 如果需要,可以使图像成为超链接。
<script type=\"text/javascript\">
function ShowArrow(spn){
   document.getElementById(spn).innerHtml(\'<img src=\"path_to_your_image\" />\');
}
</script>

<div style=\"float:left\">
  <span id=\"spnAbout\" onclick=\"ShowArrow(this.id);return false;\" style=\"background-color:#ccc;padding:5px;cursor:pointer\">About</span>
</div>
如果使用jquery,则函数将如下所示:
function ShowArrow(spn){
   $(\'#\'+spn).html(\'<img src=\"path_to_your_image\" />\');
}
    

要回复问题请先登录注册