javascript - How to bring two arrows together towards the number? -
i have system people can up/down vote. have 2 arrows, , between arrows there's number. stack overflow , reddit. problem arrows far apart number. tried padding/height/ every thing think of none of them works. in table, if mess whole table size gets messed up. here's full code.
<table class="table"> {% if posts %} {% post in posts %} <tr id="cell"> <td class="vert-align"> <div> <a href="/post/{{ post.slug }}/vote?is_up=1" class="vote"> <span class="glyphicon glyphicon-triangle-top" aria-hidden="true"></span></a> <br /> <span class="number" style="height:1px; font-family: 'passion one', cursive; "><h4 id="vote_count_{{ post.slug }}">{{ post.get_vote_count }}</h4></span> <br> <a href="/post/{{ post.slug }}/vote?is_up=0" class="vote"> <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></a> </div> </td>
i have more cells below.
this css.
.table #cell .vert-align .glyphicon{ font-size: 1em; display:inline-block; padding: 0em; } h4{ font-size: 15px; }
also if can tell me what's wrong js file appreciated. i'm trying make when user clicks arrow arrow change color , stay changed untill click arrow or other arrow. sorry if doesn't make sense i'm trying make (like stack-overflow , reddit) right now, when click arrow changes color click else, empty space on web color gets changed.
function vote(node) { var thread_id = node.attr("href").split('\/')[2]; $.ajax({ url: node.attr("href"), datatype: "json", success: function(data) { $("#vote_count_"+thread_id).html(data.count); }, error: function(data) { alert(data.responsejson.error_message); } }); } $("a.vote").on("click", function() { vote($(this)); return false; });
use relative positioning in style sheet position arrows
position: relative; left: -5px;
Comments
Post a Comment