javascript - Rotate css Font Awesome using jquery -
i wanted rotate css font awesome direction (fa fa-arrow-up) on table column on each array element when page load provided angles. create table dynamically array using javascript. arrow displaying in table column, not rotating. how can attache direction rotation on each array element
//javascript
var html = ''; (i = 0; < 7; ++i){ html += '<tr id="list">'; html +='<td>'+ days[i] +'</td>'; html +='<td>'+ max[i] +'</td>'; html +='<td>'+ average[i] +'</td>'; html +='<td>'+ "<div class='fa fa-arrow-up'> </div>"+ '</br>' + winds[i] +'</td>'; html +='</tr>'; } $('#weathertable > tbody').html(html); $(".fa-arrow-up").rotate(angle);
looks trying have arrow pointing in wind direction. im guessing can n ne e se s sw w nw , n. thats 9 cases. font awesome 4 directions covered default, n e s w. have apply rotation degrees css:
<div class='fa fa-arrow-up fa-rotate-90'> </div>
if want show other directions @ stack overflow answer here:
Comments
Post a Comment