jQuery functions not working properly on mobile
Hi,
I am working on the following site
http://findmyhaus.com/ where we used jQuery for our menu. The menu is working fine on the desktop. However when we view the site on mobile we found that the menubar is not working properly. The "How it Works" link is not working at all where as the link "Why Use FMH.com" scroll down to the bottom of the the testimonials instead of top of the testimonials. Following are the code used on header.
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
$('.property-listing ul li').each(function(){
if($(this).find('.badges').html()!=''){
$(this).find('.badges').css('display','block');
}
});
$('.toptab .tdhead').eq(0).addClass('tbactive');
$('.hovereft .signbox').eq(0).css('display','block');
$('.toptab div.tdhead').click(function(){
$('.toptab .tdhead').removeClass('tbactive');
$(this).addClass('tbactive');
$('.hovereft .signbox').css('display','none');
var cureq = $('.toptab div.tdhead').index(this);
$('.hovereft .signbox').eq(cureq).css('display','block');
});
$(' .bannerbtn').click(function(){
$('.topheader').slideUp(0);
if($('.topheader').css('display')=='none'){
$('.topheader').slideDown();
}else{
$('.topheader').slideUp();
}
$('html, body').scrollTop( 0 );
});
$('.hoework ').click(function(){
$('.topheader').slideUp(0);
if($('.topheader').css('display')=='none'){
$('.topheader').slideDown();
}else{
$('.topheader').slideUp();
}
$('html, body').scrollTop( 0 );
});
$('.howClose ').click(function(){
$('.topheader').slideUp();
});
if($('body').hasClass('home')){
$('.testimonialsOt').click(function(){
if($('.topheader').css('display')=='block'){
$('.howClose').trigger('click');
setTimeout(function(){
$('html, body').animate({scrollTop : 800},800);
//return false;
},1500);
}else {
$('html, body').animate({scrollTop : 800},800);
}
});
var mainurl = window.location.href;
var urlsplit = mainurl.split("#");
switch(urlsplit[1])
{
case "testimonials_t": setTimeout(function(){$('.testimonialsOt a').trigger("click");},500);;
break;
}
}else {
$('.testimonialsOt a').attr('href','<?php echo site_url();?>/#testimonials_t');
}
$('.addthis_sharing_toolbox').css('opacity','0');
$('.addthis_sharing_toolbox').css('right','-20000px');
$('#sharethis').click(function(){
$('.addthis_sharing_toolbox').css('right','-2px');
$('.addthis_sharing_toolbox').css('opacity','1');
});
$('.single-property').mouseleave(function(){
$('.addthis_sharing_toolbox').css('opacity','0');
$('.addthis_sharing_toolbox').css('right','-20000px');
});
});
</script>
Please help.
Thanks
Prasun