等級:25 - 爐火純青 經驗值:0 / 245 魔法值:14380 / 14380 生命值:5%
升級
  100%
TA的每日心情 | 奮斗 3 小時前 |
|---|
簽到天數: 5784 天 [LV.Master]伴壇終老
|
發表於 2016-2-18 20:10:55
|
顯示全部樓層
- var div = $('#planetSelectorWrapper');
$ C1 g2 v* `; \0 y - var Selector = div.children('select');$ O# C8 E% h" S# L" Y
- var Val = Selector.val();
2 d4 H J* ]4 M i8 | - var Option = Selector.find('option:selected');
% _! l0 b- w4 M( O5 S% E) _ - Selector.before(function() {8 g: w8 |$ z, X4 C4 X. {
- if(Option.prev().length == 1) {
6 p) Q0 `6 Z7 R" a8 K* s - div.css('width', function(index, value) {
5 P& q# I! n% `6 ` - return (parseFloat(value) + 30)+"px";5 k8 g0 a; u0 Z9 r. ?2 V/ E; u3 F; `
- });/ Y! j4 w6 `" `( |7 f
- Selector.css('margin', '37px 5px');
: F0 ^4 a& h1 k& t" p - return '<input type="button" style="margin:37px 0 0 5px;float:left;" value="<-" onclick="$(\'#planetSelector > :selected\').prev().attr(\'selected\', \'selected\');$(\'#planetSelector\').trigger(\'change\')">';
3 M6 E ]( b+ F# i" j0 P - }# W6 k# z* H. X; D8 c
- });
5 x S: s+ U& ]) K [/ z - Selector.after(function() {
! Q5 z6 A5 y- H9 b: U3 R - if(Option.next().length == 1) {; [/ c: R$ Y- z; O7 `
- div.css('width', function(index, value) {
1 _1 `& O# j! i" h - return (parseFloat(value) + 30)+"px";9 W8 j8 Q- z# K1 ~9 D2 n8 b& h
- });! O: \" t9 S2 e3 a) f- Q
- Selector.css('margin', '37px 5px');2 P- I7 i, v0 e- f
- return '<input type="button" style="margin:37px 0;float:left;" value="->" onclick="$(\'#planetSelector > :selected\').next().attr(\'selected\', \'selected\');$(\'#planetSelector\').trigger(\'change\')">';; u4 U+ t( v! M+ I- y
- }0 U/ t* v+ E9 _/ Q5 s
- });
複製程式碼
2 u, P3 e9 E( h5 i7 S4 K這就係問題原因6 Y! p! ?. W- s& \/ p1 ^. G+ v
答案就是
' ]; z& v) Q: r% {+ h, I那個星球左右鍵; k+ J$ Z9 H g, G! S& V! O6 U
5 H6 r+ [) G0 r2 q- | K4 K
經過實測9 [" k$ N, m8 t( u
刪除掉那個按鈕7 x" i- L% x2 L* P8 G5 @3 O
排版就一切正常 |
|