First:
Compatibility:
IE6 is a little slow in response, and the effect is not as good as Firefox.
The main effect is to imitate the selection area of the Windows desktop. You can use the selection box selection icon.
Because there are too many JS Code, only a piece of core code is pasted.
JS core code:
// Select () {// create a constituency VaR _ down = false for the workspace; var Pos = {X: 0, Y: 0}; var move = {X: 0, Y: 0}; $ (". working "). mousedown (function (event) {// if it is right-click if (event. button = 2) return; // If (! Certificate (event.tar get ). is (". icons ") return; _ down = true; POS. X = event. clientx; POS. y = event. clienty; $ (". select ").css (" Left ", POS. x); $ (". select "example .css (" TOP ", POS. y); $ (". select "). show () ;}); $ (". working "). mousemove (function (event) {If (! _ Down) return; move. X = event. clientx; move. y = event. clienty; // subtract 2 compatible with ievar width = move. x-pos.x-2; var Height = move. y-pos.y-2; var select = $ (". select "); // select the left if (width> = 0 & height> margin 0most then select t.css (" width ", width+#select.css (" height ", height );} else {// The selection area extends to the right if (width <0) {// returns the absolute value var w=math.abs(width?#select.css ("width", w)+select.css ("Left", move. x); If (height> defaults 0)select.css ("height", height) ;}}if (height <= 0) {var hsf-math.abs(height1_1_select.css ("height", hsf-1_1_select.css ("TOP", move. y); If (width> 0th percentile select.css ("width", width) ;}}}); $ (". working "). mouseup (function () {_ down = false; $ (". select "detail .css (" width ", 0); $ (". select ").css (" height ", 0); $ (". select "). hide ();});}
Of course, the above effect also needs to be done with CSS. The complete dome will be sent over a period of time.