Suoritettu

Make menu dropdowns work on touch devices with JAVA using double tap method

So I want to make my menu dropdowns work on touch devices too with double touch. The first touch is opening submenu (if submenu exists) and the second touch on the same menu item goes to URL. I found some javascript code that does that.

The only problem is that it only works when I am on top of the current page. If I scroll a bit and press a menu item, it doesn't open the submenu anymore and it goes directly to the link.

So it just works on top of the page. Any idea why that happening would be appreciated...

$(document).ready(function(){

//added for surface

window.USER_IS_TOUCHING = false;

[login to view URL]('touchstart', function onFirstTouch() {

window.USER_IS_TOUCHING = true;

// we only need to know once that a human touched the screen, so we can stop listening now

[login to view URL]('touchstart', onFirstTouch, false);

}, false);

function is_touch_device() {

return 'ontouchstart' in window // works on most browsers

|| [login to view URL]; // works on IE10/11 and Surface

};

$('ul > li > a').click(function(e){

var target = $([login to view URL]);

var parent = [login to view URL](); // the li

if(is_touch_device() || window.USER_IS_TOUCHING){

if([login to view URL]("active")){

//run default action of the link

}

else{

[login to view URL]();

//remove class active from all links

$('ul > li > [login to view URL]').removeClass('active');

//set class active to current link

[login to view URL]("active");

[login to view URL]("active");

}

}

});

$('ul > li').click(function(e){

//remove class active from all links if li was clicked

if ([login to view URL] == this){

$(".active").removeClass('active');

}

});

});

Taidot: Javascript, Java, jQuery / Prototype

Näytä lisää: menu dont work yootheme chrome, kind work front end java developer ejbaspvbnet, jtree codes java using netbeans, rtsp video mobile devices java, ipod touch connect internet using usb, image cropping java using selection area, joomla extended menu dont work, joomla drop menu dont work, website development java using ezpublish, login form java using database, quiz demo code java using applet, leave management project java using jsp, touch jewelry pictures using photoshop, student record maintance java using servelets jsp, work flow component created using java tibco, how to make exe file in java using netbeans, how to create a menu in java using switch, how to make exe file in java using eclipse

Tietoa työnantajasta:
( 1 arvostelu ) Argos, Greece

Projektin tunnus: #20354605

Myönnetty käyttäjälle:

diama64

autoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoautoauto

€30 EUR 1 päivässä
(88 Arvostelua)
5.6

8 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön

brightstar928

⭐⭐⭐⭐⭐ Hi I read your job description carefully. You can check my past reviews here.❤️❤️❤️ I have developed a lot of websites. I will do my best for your project until you are satisfied. If you hire me, I will finish y Lisää

€30 EUR 1 päivässä
(23 arvostelua)
6.1
ZohaibSajid

Hi, I have go through the description and see the jquery code you have attached. I see that you want the menu to work after scroll as well, as you mentioned it doesn't work on scroll page down. To get further, I want Lisää

€21 EUR 1 päivässä
(16 arvostelua)
4.6
aykutcanturkmen

Hello sir, How is it going? I have read your description carefully. As you can see from my profile, I have 10+ years experience in Full Stack development. With my expertise, i can provide you good result. I am ready t Lisää

€19 EUR 1 päivässä
(10 arvostelua)
2.7
mansiwork

Hello there, After gone through your work requirement, I believe that I can provide quality work to you. My name is Mansi, having over five years of experience in the Android & IOS App designing, Web Designing & UI/UX. Lisää

€19 EUR 7 päivässä
(4 arvostelua)
2.7
yoyo09

Hello, I am absolutely sure that I can do the project very well. I am a Java expert with 6+ years, especially I have a strong experience with Java I assure you top quality work as i look forward to a long term relatio Lisää

€15 EUR 7 päivässä
(1 arvostelu)
0.8
Piaocheng0811

* Dear,manager ! * I am senior developer with over 6 years experiences. I checked your descriptions very [login to view URL] i am sure 100 percent about project,i bid. I am clear about your [login to view URL] i have few questio Lisää

€19 EUR 7 päivässä
(0 arvostelua)
0.0
shvmgrwl

Hi, I can do this. My expertise is in ASP.NET MVC and RestFUL. I have got rich experience with web applications, responsive design. Please have a chat with me, as more details are required. I am a software developer Lisää

€14 EUR 3 päivässä
(0 arvostelua)
1.8