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
3 Answers
Reset to default 3You 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
版权声明:本文标题:html - When I click on the button show more information in the same page javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745462586a2659393.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论