Widget:HeartSoundApp: Difference between revisions

Jump to navigation Jump to search
Matt Pijoan (talk | contribs)
No edit summary
Matt Pijoan (talk | contribs)
No edit summary
Line 11: Line 11:
     $("#add").click(function(){
     $("#add").click(function(){
         var position = $("#imageHolder").offset();
         var position = $("#imageHolder").offset();
         var top = Math.round(position.top)+200;
         var top = Math.round($("#imageHolder").offset().top)+200;
         var left = Math.round(position.left)+200;
         var left = Math.round(position.left)+200;
         $("#imageHolder").append("<div src='"+$("#soundLocation").val()+"' class='soundBox'></div>");
        var style = "position:absolute; top:"+top.toString()+"; left:"+left.toString()+"width:25px; height:25px; border:1px solid #000;";
         $("#imageHolder").append("<div src='"+$("#soundLocation").val()+"' style='"+style+"'></div>");
         $("#soundLocation").val("");
         $("#soundLocation").val("");
         $("#imageHolder div").last().css({"position": "absolute", "top":top.toString(),"left":left.toString(),"width":"25","height":"25","border":"1px solid #000"});
         $("#imageHolder div").last().css({"position": "absolute", "top":top.toString(),"left":left.toString(),"width":"25","height":"25","border":"1px solid #000"});

Revision as of 20:07, 20 October 2015