javascript - I need to update the text of a paragraph by inline edit - i've tried this html <div> <h1>some text here</h1> <p>text area text here</p> </div> jquery $(function(){ $('p').on('click', function(e){ e.preventdefault(); var txt = $(this).text(); $(this).parent().append('<textarea>' + txt + '</textarea>'); $(this).remove(); }); }); i need update text of paragraph inline editing. need paragraph new text typed there , remove textarea when click outside of textarea. thanks here update fiddle http://jsfiddle.net/99pxz8et/2/ what need hear on alter event new text area , update it $area.one('focusout', function() { $p.show(); $p.text($area.val()); $area.remove() }); edit: changed .on() .one() javascript jquery
javascript - THREE.js reposition vertices for RingGeometry - codepen available here: http://codepen.io/pehrlich/pen/cogjg i want render ring geometry in scene, , dynamically alter it's arclength (thetalength). start with, i'm calling it's constructor, , recalling code positions vertices. however, causes unusual results. here's method phone call - copied constructor , given new name of setthetalength: three.ringgeometry.prototype.setthetalength = function(thetalength){ // this.thetalength = thetalength; var i, o, uvs = [], radius = this.innerradius, radiusstep = ( ( this.outerradius - this.innerradius ) / this.phisegments ); ( = 0; < this.phisegments + 1; ++ ) { // concentric circles within ring ( o = 0; o < this.thetasegments + 1; o ++ ) { // number of segments per circle var vertex = this.vertices[i + o]; // maybe need query vertex indices here. var segment = this.thetastart + o / this.thetasegments *...
assembly - What is the addressing mode for ld, add, and rjmp instructions? - hey guys know ldi (load immediate) addressing mode set immediate , st instruction addressing mode set index. however, have no thought others curious are! thanks :) the addressing modes explained in instruction set, in first few pages. in table of instructions see operands instruction determine addressing mode. mode indicated arguments assembly instruction. for example, ld had several different ways of operating, depending on arguments. 1 of them ld rd,x d number of register, such ld r3,x . ld r3,-z else (although both indirect addressing). rjmp k relative addressing, jumping pc + k + 1. add rr,rd direct register addressing. result contained in rd. assembly avr instructions
Comments
Post a Comment