Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8602953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:12:39+00:00 2026-06-12T02:12:39+00:00

I have the following HTML <li onclick=setServerID(this); class=server-item-item data-server=1 onmousedown=serverHold(this); onmouseup=serverRelease();><span>MyServer</span></li> My JS looks

  • 0

I have the following HTML

<li onclick="setServerID(this);" class="server-item-item" data-server="1" onmousedown="serverHold(this);" onmouseup="serverRelease();"><span>MyServer</span></li>

My JS looks like:

function setServerID(server) {
    sessionStorage.serverID = server.dataset.server;
    getServerInfo();
    gotoMain();
}

And

function serverHold(server) {
    pressTimer = window.setTimeout(function() {
        var id = server.dataset.server;
        clearTimeout(pressTimer);
        $('#fav-the-server').css("visibility", "visible");
        a.slide('fav-the-server', "left", 0, "200ms", "ease", "0ms", "1", "alternate", "running");

    },1000);
    return false;
}

This all works fantastically thanks to previous posts I looked up on SO but the issue is that its a touchscreen type app and it executes the onclick

Anyway to do this that lets me get the following functionality:

List Item -> Click and Hold for 1000ms -> Execute serverHold and do
not execute the setServerID

AND

List Item -> Click and do not hold or hold for less than 1000ms – >
Execute setServerID only.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:12:41+00:00Added an answer on June 12, 2026 at 2:12 am

    Just keep a flag indicating if you have processed a long press during the click: demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html that renders within an ASP.NET Repeater: <div class=divDE-item onclick=addFilter(this);>
I have an html fragment like the following: <li> <img src=/jsafe/gallery/item/83/thumb /> <span class=tools>
I have the following html : <div class=mainmenu> <ul class=blue> <li class=><a href=tst/ id=a1_up><span
I have the following html: <label wicket:id=drugSearchResult.row.item.label for=drug_1>[Drug XYZ] <span wicket:id=drugSearchResult.row.item.info>[Information, Price, Other]</span> </label>
I have the following HTML code: <td align=center class=shuttleControl> <img src=/i/mydb/icons/shuttle_reload.png onclick=g_Shuttlep_v61.reset(); alt=Reset title=Reset/>
Ok I have a small question. I have the following <div><span class=spanright onclick>Update</span><label class=myinfo><b>Business
I have following HTML: <div class=olympics style=display: block; position: absolute; left: 250px; top: px;>
I have following HTML <tr id=r1 class=l1> <td><img class=plusminus id=r1c1 src=assets/images/plus.png border=0 />3/10/12</td> <td></td>
I have the following html table <table id={64ED3A94-5833-4CC7-869F-CCE583B498BE} class=ms-listviewtable width=100% cellspacing=0 cellpadding=1 border=0 xmlns:o=urn:schemas-microsoft-com:office:office
I have the following HTML <div class=myclass value=1> <div> <div class=myclass value=> <a class=popup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.