2012-05-07 7 views
0

私が作業しているページには、それぞれ1つの画像を含むdiv-id(dragZone)が含まれています これらはすべてドラッグ可能、クリックすると前方に移動します。.resizable 'img'関数からimgファイルを除外

私は$( 'img')で塗りつぶされた.resizableを得るにはサイズ変更可能ですが、これは現在ページ上の他のすべての画像に影響します。

dragzone-idにある画像ファイルのみに.resizableを適用する方法はありますか?これが唯一のあなたはまた、dragZone内の画像要素を見つけるためにfindメソッドを使用することができますdragZone divの

答えて

0

内のimgのを取得します

$('#dragZone img').resizable({maxHeight: 600, aspectRatio: true, animate: true }); 

$(document).ready(function() { 
var a = 3; 
$('#dragZone > div').draggable({ 
start: function(event, ui) 
{ $(this).css("z-index", a++); }}) 

$('img').resizable({maxHeight: 600, aspectRatio: true, animate: true }); 

$('#dragZone > div').click(function() { 
    $(this).addClass('top').removeClass('bottom'); 
    $(this).siblings().removeClass('top').addClass('bottom'); 
    $(this).css("z-index", a++); 

}); 
});  
0

変更

$('img').resizable({maxHeight: 600, aspectRatio: true, animate: true }); 

$('#dragZone').find('img').resizable({maxHeight: 600, aspectRatio: true, animate: true }); 
+0

これは恥ずかしいものです。私は実際にそれを試みましたが、それは動作しませんでした..今はありません。ありがとう! – user1379378

+0

問題はありません、私たちの最高のことが起こります!がんばろう! – Timm