admin管理员组

文章数量:1425863

  <a href="#"  class="button">Read More</a><br>

I have this button on the website I don't know how to program the button that when I click Read more show me the information of the cd that I am selling.

Can you give me an idea how can I do that?

  <a href="#"  class="button">Read More</a><br>

I have this button on the website I don't know how to program the button that when I click Read more show me the information of the cd that I am selling.

Can you give me an idea how can I do that?

Share Improve this question edited Jun 13, 2013 at 5:45 yvonnezoe 7,4278 gold badges33 silver badges47 bronze badges asked Jun 13, 2013 at 5:37 Liliana TorresLiliana Torres 251 gold badge2 silver badges6 bronze badges 2
  • Wele to SO. There is a lot you can do with JavaScript, e.g- redirect the user to a different page, show a div temporarily to the user, show a blocking dialog box etc. You need to provide more information as to what exactly you want to do. You may edit the question and add more details of what you want for an accurate answer. – Alok Swain Commented Jun 13, 2013 at 5:39
  • u can use jqurey tool tip. jqueryui./tooltip/#custom-style – Fasil kk Commented Jun 13, 2013 at 5:42
Add a ment  | 

3 Answers 3

Reset to default 3

You can use JQuery which is a really nice framework to make the coding easy!

You want to use the .click() event and the .show() function

So you could have something like this

$("#clickme").click(function() {
     $("#hidden").show();
});

and for your html

<html>
<body>
<p id="clickme">Read More</p>
<p id="hidden" hidden>COOL STORY BRO</p>
</body>
</html>

Example

Suppose you have,

<div id="dvInfo">
 Here is your question and i am giving an answer. 
</div>
<a href="javascript:void()" id='see'>See more</a>

So,
In jQuery

$(document).ready(function(){
  var f_text = $('#dvInfo').html();
  $('#dvInfo').html($('#dvInfo').html().substring(0,8)+"...");
  $('#see').click(function(){
   $('#dvInfo').html(f_text);
  });
});

html part

<asp:Button ID="btnread" runat="server" Text="Button" /> <div id="divinfo" style="display:none">More Info</div>

jquery part:

    $(function () {
        $("#<%=btnread.ClientID %>").click(function () {
            $("div[id$=divinfo]").css("display", "block");
            return false;
        });
    });

本文标签: htmlWhen I click on the button show more information in the same page javascriptStack Overflow