Здравствуйте. Есть скрипт выбора цвета. Все работает прекрасно, но drag&drop не пашет на всяких яблочных устройствах. Как сделать, чтобы он на них работал? Или же изменить так, чтобы цвет выбирался по клику, как проще?
/* Включаем drug and drop */
$('.img_fabric').draggable({
helper : 'clone',
opacity : 0.3
});
$('.basic_fabric').droppable({
tolerance : 'intersect',
accept : '.img_fabric',
drop : function(event, ui) {
obj = $(ui.draggable).clone();
$(obj).css('height', $(this).height()-10);
$(obj).css('width', $(this).height()-10);
$(obj).css('marginLeft', '5px');
html = "<div ><span style='font-weight: bold; font-size: 14px; display: block;'>"+$(obj).attr('id_title')+"</span><span style='font-weight: normal; font-style: italic; font-size: 14px; display: block;'>Основной цвет</span><span style='font-weight: normal; font-size: 12px; display: block;'>Вариант: "+$(obj).attr('id_variant')+"</span><span style='font-weight: normal; font-size: 12px; display: block;'>Категория: "+$(obj).attr('id_category')+"</span><span style='font-weight: normal; font-size: 12px; display: block;'>Тип: "+$(obj).attr('id_type')+"</span></div>"
var id_cat_price = $(".fabric_prices[id_category = "+$(".companion_fabric .img_fabric").attr('id_category')+"]").attr('id_cat_price');
id_cat_price = (String(id_cat_price) == 'NaN')?0:id_cat_price;
var id_companion = parseFloat(id_cat_price);
var tov_price = $("#formated_price").text();
tov_price = tov_price.replace(" ", "");
tov_price = tov_price.replace(" р.", "");
tov_price2 = parseFloat(tov_price);
var this_price = parseFloat($(".fabric_prices[id_category = "+$(obj).attr('id_category')+"]").attr('id_cat_price'));
this_price = (String(this_price) == 'NaN')?0:this_price;
id_price_val = $(".fabric_prices[id_category = "+$(obj).attr('id_category')+"]").attr('id_price_val');
var real_price = tov_price2 + this_price;
if(String(id_companion) == 'NaN' || (real_price >= id_companion+tov_price2)){
$("#tov_real_price").html(real_price);
id_price_val_final = id_price_val;
}
$(this).html(obj);
$(this).html("<table style='display: inline-block; text-align: left; width: 265px; height: "+($(this).height()-10)+"'><tr><td>"+$(this).html()+"</td><td>"+html+"</td></tr></table>");
}
});
$('.companion_fabric').droppable({
tolerance : 'intersect',
accept : '.img_fabric',
drop : function(event, ui) {
obj = $(ui.draggable).clone();
$(obj).css('height', $(this).height()-10);
$(obj).css('width', $(this).height()-10);
$(obj).css('marginLeft', '5px');
html = "<div ><span style='font-weight: bold; font-size: 14px; display: block;'>"+$(obj).attr('id_title')+"</span><span style='font-weight: normal; font-style: italic; font-size: 14px; display: block;'>Цвет фасадов</span><span style='font-weight: normal; font-size: 12px; display: block;'>Вариант: "+$(obj).attr('id_variant')+"</span><span style='font-weight: normal; font-size: 12px; display: block;'>Категория: "+$(obj).attr('id_category')+"</span><span style='font-weight: normal; font-size: 12px; display: block;'>Тип: "+$(obj).attr('id_type')+"</span></div>"
var id_cat_price = $(".fabric_prices[id_category = "+$(".basic_fabric .img_fabric").attr('id_category')+"]").attr('id_cat_price');
id_cat_price = (String(id_cat_price) == 'NaN')?0:id_cat_price;
var id_basic = parseFloat(id_cat_price);
var tov_price = $("#formated_price").text();
tov_price = tov_price.replace(" ", "");
tov_price = tov_price.replace(" р.", "");
tov_price2 = parseFloat(tov_price);
var this_price = parseFloat($(".fabric_prices[id_category = "+$(obj).attr('id_category')+"]").attr('id_cat_price'));
this_price = (String(this_price) == 'NaN')?0:this_price;
id_price_val = $(".fabric_prices[id_category = "+$(obj).attr('id_category')+"]").attr('id_price_val');
var real_price = tov_price2 + this_price;
if(String(id_basic) == 'NaN' || (real_price >= id_basic+tov_price2)){
$("#tov_real_price").html(real_price);
id_price_val_final = id_price_val;
}
$(this).html(obj);
$(this).html("<table style='display: inline-block; text-align: left; width: 265px; height: "+($(this).height()-10)+"'><tr><td>"+$(this).html()+"</td><td>"+html+"</td></tr></table>");
}
});