arcCalc();
function scriptCheck() {
// --- Script integrity check ---
// is required empty?? then add the image link
if ($('#required').length == 0) {
$('#required').append('<div id="required">' +
'<p><a id="addToSite" href="#"> "Add this calculator to your site!</a></p>' + '</div>'); // update later to variable set to image
}
// has the image link been changed? change it back!
if ($('#reqLink').attr("href") !== "http://www.graphicproducts.com") {
$('#reqLink').attr("href", "http://www.graphicproducts.com");
}
//
}
function buildCalc() {
// Insert parent DOM node for calc and append child elements
$('#gpEmbedCalc-afc').after('<div id="arcFlashWrapper"></div>');
// replace this with the actual HTML when design is ready
$('#arcFlashWrapper').append('<div id="arcFlashInputs"></div>');
var inputEls = {
'Rating': 'Device Rating',
'Volts': 'System Voltage',
'Gap': 'Arc Gap',
'Lgibf': 'Fault Current',
'Distance': 'Distance to Arc'
}
$.each(inputEls, function(key, value) {
$('#arcFlashInputs').append($('<label>', {
'for': key,
text: value
}));
$('#arcFlashInputs').append($('<select>', {
id: key,
text: value,
size: "1"
}));
});
// After DOM elements load, load up selects with options
// Device Rating
var ratingValues = [30, 60, 100, 200, 400, 600, 800, 1200, 1600, 2000];
$.each(ratingValues, function(value) {
$('#Rating').append($('<option/>', {
value: this,
text: this + 'A'
}));
});
// System Voltage
var voltsValues = [208, 240, 480, 600]
$.each(voltsValues, function(value) {
$('#Volts').append($('<option/>', {
value: this,
text: this + 'V'
}));
});
// Arc Gap
var gapValues = { '31.75': '1.25in'};
$.each(gapValues, function(key, value) {
$('#Gap').append($('<option/>', {
value: key,
text: value
}));
});
// Fault Current
var LgibfValues = {
'1:0.00000' : '1KA',
'2:0.30103' : '2KA',
'3:0.60206' :...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.