Skip to content

Instantly share code, notes, and snippets.

View KeithNdhlovu's full-sized avatar

Keith Ndhlovu KeithNdhlovu

View GitHub Profile
$(document).ready(function(){
var mobi = Snap("#livx-processes-mobi");
//Load Mobile Processes
if(mobi != null){
Snap.load("images/mobile/livx-process-mobile.svg", function ( f ) {
mobi.append( f.select("#content") );
});
}
Snap.plugin(function (Snap, Element, Paper, glob) {
Paper.prototype.multitext = function (x, y, txt, max_width, attributes) {
var svg = Snap();
var abc = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var temp = svg.text(0, 0, abc);
temp.attr(attributes);
var letter_width = temp.getBBox().width / abc.length;
svg.remove();