$(".full_search ul a").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;
});
каким образом мне присобачить к этому коду
вот это
var userAgent = navigator.userAgent.toLowerCase();
var isiPhone = (userAgent.indexOf('iphone') != -1 || userAgent.indexOf('ipad') != -1 ) ? true : false;
clickEvent = isiPhone ? 'tap' : 'click';
я так полагаю должно быть что то вроде этого
if (isiPhone) {
Ток вот что тут надо вписать
} else {
$(".full_search ul a").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;
});
}