jquery uiの
jQuery( '.Selector' ).draggable( 'disable' );
において、<div>で囲んだ文字にこれをやると文字色が変わる(薄くなる?)のですが直す方法はないのでしょうか? 使っているブラウザはchromeです。
気になる質問をクリップする
クリップした質問は、後からいつでもMYページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
回答1件
0
ベストアンサー
disableの際にui-draggable-disabledが付加されるようです。
CSSで、 .ui-draggable-disabled を上書きで作成するか、
jquery-ui.js/jquery-ui.min.jsの以下の箇所を修正しちゃうかですね。
jquery
1 if (this.options.disabled){ 2 this.element.addClass("ui-draggable-disabled"); 3 } 4... 5 _destroy: function() { 6 if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { 7 this.destroyOnClear = true; 8 return; 9 } 10 this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); 11 this._removeHandleClassName(); 12 this._mouseDestroy(); 13 },
確かに、付加されているようです。
HTML
1<html> 2<head> 3<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> 4<script src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> 5<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> 6 7<script> 8$(document).ready(function(){ 9 $(".test").draggable(); 10 $(".test").mousedown( 11 function(){ 12 $(".test").draggable('enable'); 13 $("#disp").text(this.id + ":" + $(this).attr('class')); 14 }); 15 16 $(".test").mouseup( 17 function(){ 18 $(".test").draggable('disable'); 19 $("#disp").text(this.id + ":" + $(this).attr('class')); 20 } 21 ); 22}); 23</script> 24</head> 25 <body> 26 <div id="disp"></div> 27 <img id="img" class="test" src="https://cdn.teratail.com/uploads/avatars/20436/71Co1ZWT_thumbnail.jpg?1435125075"> 28 <div id="div" class="test">****</div> 29 </body> 30</html>
私の環境では、薄くなっているようには見えませんでした。。。
投稿2015/09/26 22:39
編集2015/09/26 22:40総合スコア1768
あなたの回答
tips
太字
斜体
打ち消し線
見出し
引用テキストの挿入
コードの挿入
リンクの挿入
リストの挿入
番号リストの挿入
表の挿入
水平線の挿入
プレビュー
質問の解決につながる回答をしましょう。 サンプルコードなど、より具体的な説明があると質問者の理解の助けになります。 また、読む側のことを考えた、分かりやすい文章を心がけましょう。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。