等級:25 - 爐火純青 經驗值:0 / 245 魔法值:14380 / 14380 生命值:5%
升級
  100%
TA的每日心情 | 奮斗 4 小時前 |
|---|
簽到天數: 5784 天 [LV.Master]伴壇終老
|
發表於 2016-2-18 20:10:55
|
顯示全部樓層
- var div = $('#planetSelectorWrapper');
w$ e% W* X# P* g& D& g2 I. r - var Selector = div.children('select');
5 \: Y2 t: b$ [* ~ B- A% h% A7 ` - var Val = Selector.val();
4 \+ h+ G8 @7 R1 w3 H; C, z# T - var Option = Selector.find('option:selected');
9 R8 q/ Y3 X/ ` - Selector.before(function() {' y( q0 k& v1 [7 t# u- ^
- if(Option.prev().length == 1) {
1 {5 f2 Q5 `+ t; @" w. @9 s6 k - div.css('width', function(index, value) {
) y* q' E: k! N# V4 Z - return (parseFloat(value) + 30)+"px";
0 d% [0 l$ S" }; } - });
, h }' F1 R* \& c0 H; n1 _7 H/ ? - Selector.css('margin', '37px 5px');8 \& }/ U$ ]* F2 Q
- return '<input type="button" style="margin:37px 0 0 5px;float:left;" value="<-" onclick="$(\'#planetSelector > :selected\').prev().attr(\'selected\', \'selected\');$(\'#planetSelector\').trigger(\'change\')">';
, \$ a6 U7 @% K8 I# V. d' w - }$ e, E+ K, K% G9 B9 }' ?7 J
- });9 [* V8 n. R8 F, q8 w3 K4 Z" h
- Selector.after(function() {. @1 E! x( y" Y, R2 X9 C- x
- if(Option.next().length == 1) {/ w" q, u; G' {2 E7 l% I" G
- div.css('width', function(index, value) {" S' a" x2 L( b6 E
- return (parseFloat(value) + 30)+"px";
( H% T& t. |3 u9 O: z+ ^ - });! R" ]. q* M4 B/ U. q, F# O! m
- Selector.css('margin', '37px 5px');2 R; L( I i3 P7 \; j) A
- return '<input type="button" style="margin:37px 0;float:left;" value="->" onclick="$(\'#planetSelector > :selected\').next().attr(\'selected\', \'selected\');$(\'#planetSelector\').trigger(\'change\')">';) e& l+ v% ^, ^- E% {
- }
! A* O4 h- v- l5 p1 Q$ l5 _ - });
複製程式碼 8 s |) Y3 G6 r/ l
這就係問題原因
& W7 s, t1 {/ I8 M8 E答案就是4 z; U- F L2 Y7 R" `
那個星球左右鍵; u/ v$ E( F% {* t
0 V& J: Y2 n, P% q$ e+ i. l$ R& ^0 G6 x經過實測
# E8 M1 N% V' K Q( r( n刪除掉那個按鈕
2 g; t$ E( K7 E9 K, y9 s排版就一切正常 |
|