0

我目前在左侧有一个标题和一个图像单击文本之前

当用户单击此链接时,会出现说明

出现文字

我这样做使用:

<script type="text/javascript">
    $(document).ready(function () {
        $(".hidden").hide();
        $("p.show").click(function () {
            $(this).next(".hidden").toggle()
        });
        $("p.show").hover().css('cursor', 'pointer');
    });
</script>

但是,我希望在文本出现时更改图像。我尝试使用 replaceWith 但这没有用。我还是 jQuery 的新手,所以任何建议都很棒。我不需要答案,只需要一个关于什么是最好的指针。

<p style="color:Black;float:left;padding-top:0px;" class="show">
<img alt="+" src="resources/images/plussign.jpg" style="float:left; margin-right:10px;"/>What is EFM?<br /></p>
<div class="hidden">
  <p style="margin-left:20px;">
    <br />EFM, also known as Ethernet in the First Mile, is an Ethernet leased line
    service that runs over copper rather than the fibre optic cable used for
    other Ethernet services. The copper is provided in bonded pairs, making
    the connection extremely robust. If one copper pair fails, the others remain
    live, meaning you don’t suffer any downtime and can continue working with
    reduced bandwidth until normal service is restored.</p>
</div>
4

1 回答 1

0

做这个,

<img id="myimg" alt="+" src="resources/images/plussign.jpg" style="float:left; margin-right:10px;" />



$('#mying').attr('src','nextimage');  
于 2012-10-23T09:00:17.967 回答