Here is the code that I'm working with. I want to be able to position the symbol within a HTML box using JQuery. Any help would be appreciated. I also need to be able to be able to change the size of the rendered and position symbol by using the following .css("font-size","75%")
<!-- saved from url=(0022) -->
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="
http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="
https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text",
ev.target.id);
}
//
ev.target.id this gives us the id of the symbol being dragged
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
//ev.target.appendChild(document.getElementById(data));
switch(data)
{
case("drag1"):
$('#second').append('$$\\sum$$');
break;
case("drag2"):
$('#second').append('$$\\int$$');
break;
case("drag3"):
$('#second').append('$$\\alpha$$');
break;
case("drag4"):
//$('#second').css("font-size","150%");
$('#second').append('$$\\beta$$').css("font-size","150%");
break;
case("drag5"):
$('#second').append('$${du}$$');
break;
case("drag6"):
$('#second').append('$${dt}$$');
break;
case("drag7"):
$('#second').append('$${t}$$');
break;
case("drag8"):
//$('#second').append('$$\\beta$$').css("font-size","150%");
$('#second').append('$${t}^x\sqrt{t}^x$$');
$('#container').append('<div id="third" ondrop="drop(event)" ondragover="allowDrop(event)"></div>');
$('#third').append('$${t}^x\sqrt{t}^x$$').css("font-size","75%");
// works //$('#third').append('$${t}^x\sqrt{t}^x$$').css( { position: 'relative', zIndex:1000, left: 10px} );
//not working //$('#third').append('<label>Filename:</label> <input type="text" name="file" id="file" />');
break;
default:
}
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"second"]);
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"third"]);
}
</script>
<style>
#header {
width: 100%;
background-color: white;
height: 30px;
}
#container {
width: 600px;
height:1500px
background-color: #ffffff;
margin: auto;
}
#first {
width: 100px;
border: 2px solid black;
float: left;
height: 400px;
}
#second {
width: 300px;
border: 2px solid black;
top:0;
float: right;
height: 100px;
}
#third {
position: absolute;
top: 180px;
border: 2px solid black;
right:430px;
width: 200px;
height: 100px;
}
#third .power1{
width: 20px;
height: 10px;
float: left;
border: 2px solid black;
}
#clear {
clear: both;
}
</style>
</head>
<body>
<div id="header"></div>
<div id="container">
<div id="first">
<span id="drag1" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$$\sum$$</span>
<span id="drag2" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$$\int$$</span>
<span id="drag3" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$$\alpha$$</span>
<span id="drag4" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$$\beta$$</span>
<span id="drag5" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$${du}$$</span>
<span id="drag6" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$${dt}$$</span>
<span id="drag7" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$${t}$$</span>
<span id="drag8" style="text-decoration:overline;" draggable="true" ondragstart="drag(event)" >$${t}^x\sqrt{t}^x$$</span>
</div>
<div id="second" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<div id="clear"></div>
</div>
</body>
</html>