Re: Performing Double Click and Drag & Drop using Javascript

Friday, November 2, 2012

Have you tried setting a setTimeout() that when the user interacts with the element, you call element.trigger('click') twice?




On Sat, Nov 3, 2012 at 12:58 AM, SACHIN V <mr.vsachin@gmail.com> wrote:


   Hi Nathan & Cyberoot,

          I have a webpage where If I double click on an element it performs some action, but onDbClick() is not directly implemented on it. I'm trying to automate that part, where I can perform the double click using JavaScript so that corresponding action is triggered as it would happen if a user double clicks on it.

It would be great if you can help me on this?

I tried using initEvents(), but it is giving me the desired results.

Regards,
V Sachin





On Friday, November 2, 2012 9:46:37 AM UTC+5:30, cyberoot wrote:
Like this??
cyberoot.blogspot.com/p/cyber-drag.html
Source Code
<html lang="en">
<head>
 <title>Drag Cyberoot Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.23/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
<style>
 #cyberdrag { border:1px solid green;width: 170px; height: 100px;padding:10px; border-radius:10px;}
 </style>
 <script>
 $(function() {
  $( "#cyberdrag" ).draggable();
 });
 </script>
</head>
<body bgcolor="black">
<div id="cyberdrag">
<span style="color: orange;">
 ကၽြန္ေတာ္ကိုဆြဲပါ <span style="color: red;">^_^</span><br />
 cyberoot.blogspot.com
</span>
</div>
</body>
</html>

On Fri, Nov 2, 2012 at 7:26 AM, Nathan Mynarcik <nat...@mynarcik.com> wrote:
So you want to trigger a double click without the user doing anything? Or demonstrate a double click to the user (i.e. custom cursor that looks like it is clicking down twice)?

I'm kinda confused on what exactly you are trying to achieve.





On Sat, Oct 27, 2012 at 9:50 AM, SACHIN V <mr.vs...@gmail.com> wrote:

Hi All,

I want to simulate performing double click and Drag & Drop using JavaScript.I don't want to call ondbClick(), as it is usually called when a user performs a double click. Here I want to perform the double click itself.
Can anyone tell me how can I achieve this?


Regards,
Sachin

--
 
 

--
 
 


--
 
 

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Copyright © 2010 Web Design | Free Blogger Templates by Splashy Templates | Layout by Atomic Website Templates

Vida de bombeiro Recipes Informatica Humor Jokes Mensagens Curiosity Saude Video Games Animals Diario das Mensagens Eletronica Rei Jesus News Noticias da TV Artesanato Esportes Noticias Atuais Games Pets Career Religion Recreation Business Education Autos Academics Style Television Programming Motosport Humor News The Games Home Downs World News Internet Design Entertaimment Celebrities 1001 Games Doctor Pets Net Downs World Enter Jesus Mensagensr Android Rub Letras Dialogue cosmetics Genexus lasofia thebushrajr wingshock tripedes gorduravegetal dainfamia dejavu-transpersonal jsbenfica republicadasbadanas ruiherbon iranianforaryans eaystcheyl fotosdanadir Só Humor Curiosity Gifs Medical Female American Health Madeira Designer PPS Divertidas Estate Travel Estate Writing Computer Matilde Ocultos Matilde futebolcomnoticias girassol lettheworldturn topdigitalnet Bem amado enjohnny produceideas foodasticos cronicasdoimaginario downloadsdegraca compactandoletras newcuriosidades blogdoarmario arrozinhoii