[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: isiPhone и touchstart
Гость_Андрей
Доброго времени суток ! у меня есть готовый скрипт меню, но он не работает на ipad мне надо просто прописать проверку , если ipad то забиндить touchstart, если нет то просто click одну часть то я сделал , а вот другую не пойму как!
Xander
упс я забыл зайти пишите мне в общем если кто сможет помочь!
Xander
вот сам скрипт

var userAgent = navigator.userAgent.toLowerCase();
var isiPhone = (userAgent.indexOf('iphone') != -1 || userAgent.indexOf('ipad') != -1 ) ? true : false;
clickEvent = isiPhone ? 'tap' : 'click';

if (isiPhone) {
$(".full_search ul a").bind('touchstart',function(){
тут вот какой то код

});
} else {
$(".full_search ul a").bind('click',function(){

key=$(this).parent().parent().attr('rel');
val=$(this).attr('rel');

if(key=='l'){
p_l=val;
}
else if(key=='s'){
p_s=val;
}
else if(key=='t'){
p_t=val;
}

$(this).attr({'href':'/properties/?l='+p_l+'&s='+p_s+'&t='+p_t+'&g='+p_g+'&p1='+p_p1+'&p2='+p_p2});

if(currlink!=$(this).attr('href')){
load_obj($(this).attr('href'), "new");
currlink=$(this).attr('href');
}

var cur_sel = $(this).parent().parent().find("li:first-child a").text();
var cur_sel_href = $(this).parent().parent().find("li:first-child a").attr('href');
var cur_sel_rel = $(this).parent().parent().find("li:first-child a").attr('rel');

$(this).parent().parent().toggleClass("active_select");
$(this).parent().parent().find("li:first-child a").text($(this).text());
$(this).parent().parent().find("li:first-child a").attr({'href': $(this).attr('href')});
$(this).parent().parent().find("li:first-child a").attr({'rel': $(this).attr('rel')});
$(this).text(cur_sel);
$(this).attr({'href': cur_sel_href});
$(this).attr({'rel': cur_sel_rel});
return false;
});
}
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.