472,353 Members | 2,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Change the div position when certain event triggers (Using pure JavaScript)

Amendachase
Change the div position when certain event triggers (Using pure JavaScript) Hi everyone, I hope you are all doing well. I am looking forward to achieving a vibration effect for a div that is relatively positioned, dynamically on click event in pure javascript without any typescript injections, Is there any optimum way to achieve said milestone with pure javascript. I have some solutions which are typescript based, but I want it in pure javascript. The closest solution I have come across is this code.
Expand|Select|Wrap|Line Numbers
  1. $('.button').css('transform', 'translate3d(0px, -8px, 0px)');
  2.  
First, itís in typescript, and secondly, it generates a one-dimensional effect as depicted in this tool, but I want the outcome to be multidimensional and smoother(more natural looking).
May 30 '21 #1
1 5940
Banfa
9,065 Expert Mod 8TB
Not really my area of expertise so maybe not the answer you are looking for but you can access any element directly to change it's style directly through the HTML DOM e.g.

Expand|Select|Wrap|Line Numbers
  1. document.getElementById("YourDiv").style.<property> = "new style";
More info at https://www.w3schools.com/js/js_htmldom_css.asp
Jun 4 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ritskits | last post by:
I have the dropdownlist that is populated when the form is loaded. I have the button that opens search child window using the modalwindowdialog and...
1
by: josh | last post by:
Hi, I have several independent, system components that write audit events to a database locally via ODBC and remotely via TCP, and I have a...
2
by: ChrisO | last post by:
I've been pretty infatuated with JSON for some time now since "discovering" it a while back. (It's been there all along in JavaScript, but it was...
3
by: jnag | last post by:
Hello, I have a website with various font options (small to large) buttons that the user can click on the banner, which runs through the site....
4
by: yumbelie | last post by:
Hi, I've got an issue where I've created a prototype that contains 2 methods, and a few private variables. The first method simply registers the...
1
by: Fan Zhang | last post by:
Dear All: Is it possible that someone can kindly tell me how to detect the change of a certain cell? environment is VSTO + VS 2008 + EXCEL...
0
by: Alan Mailer | last post by:
After a user edits a Cell in one of my DataGridViews, I want to make sure what the user has typed in is 'valid'. If it's not, I want to Cancel the...
3
by: bnsmith001 | last post by:
I have a text file with 29766 words in it. Currently, the file is formatted with one word per line, followed by a DOS CR/LF. I'd like to write a...
1
by: Stefan Tudoran | last post by:
Ok..so i've just started to learn C# and i want to make a button to change his position when i get the cursor over
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.