等級:25 - 爐火純青 經驗值:0 / 245 魔法值:14142 / 14142 生命值:5%
升級
  100%
TA的每日心情 | 奮斗 4 小時前 |
---|
簽到天數: 5695 天 [LV.Master]伴壇終老
|
發表於 2016-2-18 20:10:55
|
顯示全部樓層
- var div = $('#planetSelectorWrapper');- u1 ~8 M" y6 I. G. G. j0 `
- var Selector = div.children('select');
5 {- o- z. J! z- ^ - var Val = Selector.val();$ a. A) W' y' k! A* q) r
- var Option = Selector.find('option:selected');
, _3 m- T; `* p5 K b. o$ a3 y: t - Selector.before(function() {4 @* J* E6 l0 r6 B. S1 K
- if(Option.prev().length == 1) {
. {2 B" w. ~: O, t0 O! s! Q - div.css('width', function(index, value) {9 M$ ]( ?: f! c) |6 C8 q
- return (parseFloat(value) + 30)+"px";$ L0 I6 T6 Z& b2 D$ s
- });+ v3 a8 b$ _# r, [1 }; M* W( A
- Selector.css('margin', '37px 5px');
/ K5 d z2 f# ?% c: a - return '<input type="button" style="margin:37px 0 0 5px;float:left;" value="<-" onclick="$(\'#planetSelector > :selected\').prev().attr(\'selected\', \'selected\');$(\'#planetSelector\').trigger(\'change\')">';7 l w/ d: H+ v% L0 w
- }
& F7 H+ z: y& N* F0 h - });
5 H V) m% G9 M: r- C# J* ` - Selector.after(function() {
* U/ I7 N" V' G7 X% M1 q9 H2 e6 t - if(Option.next().length == 1) {
6 e" y/ z, \- t3 z- Z0 ]! E - div.css('width', function(index, value) {. m) p4 R9 z0 ?; P! X7 r7 m
- return (parseFloat(value) + 30)+"px";
" W# X/ K3 p: a - });
' D; z0 @! P- R- x; } - Selector.css('margin', '37px 5px');" t0 Z" f# B! g. N9 z2 u: \
- return '<input type="button" style="margin:37px 0;float:left;" value="->" onclick="$(\'#planetSelector > :selected\').next().attr(\'selected\', \'selected\');$(\'#planetSelector\').trigger(\'change\')">';4 j( z- l0 O% M5 P5 u- j
- }
$ y& x4 j* x3 a9 ^2 R* O - });
複製程式碼
6 i" B: v+ d( N這就係問題原因
) T' X- }* }2 N" v! b9 I/ s答案就是 `0 ~* p. }' B$ g5 q
那個星球左右鍵4 X" i1 I. o2 f2 y& f
+ F! Y. ^8 }; t `5 r
經過實測) A8 |! {3 U0 B" Q5 B; R
刪除掉那個按鈕2 `6 D ?% ~" ~' @, `- Z
排版就一切正常 |
|