I created this, which you can use for the arrow pointing to the right.
There are two variables in the script: widthofarrow and colorofarrow. By changing them, you can create an arrow of any size or color.
http://jsfiddle.net/FKekh/3/
HTML:
<!DOCTYPE html> <div id="main"></div>
CSS
.rectcontainer { height:30px; } .arrowblock { } .arrowright { float:right; } .rect { width:100px; height:10px; background-color:transparent; }
JAVASCRIPT:
widthofarrow=130; colorofarrow="#345678"; $("#main").append("<div class='arrowblock'><div class='arrowright'></div><div class='rectcontainer'><div class='rect'></div><div class='rect' style='background-color:" + colorofarrow + "'></div><div class='rect'></div></div></div>"); $('.arrowblock').css('width', widthofarrow + 'px'); $('.rectcontainer').css('width', (widthofarrow - (30)) + 'px'); $('.arrowright').css('border-top', (15) + 'px solid transparent'); $('.arrowright').css('border-bottom', (15) + 'px solid transparent'); $('.arrowright').css('border-left', (widthofarrow/4.333333333333333) + 'px solid ' + colorofarrow);
EDIT
I updated the excellent JoshC code so that it can be used to create arrows of different sizes and colors.
http://jsfiddle.net/fqcFp/2/
source share