Category "jquery"

Submitting a form with ajax in Wordpress

I am trying to get the results of an ajax request in wordpress, but I am getting result of '0' in an alert box of javascript, so the form looks like this: <

Multiple IDs in a single JavaScript click event

In JavaScript I am using click event to change chart data. Below is a method for click event. $('#pro1').click(function () { chart.series[0].update

How to dynamically create '@-Keyframe' CSS animations?

I have a requirement to rotate a div and stop at a particular position ( The value will be received from the server). I tried native JS to rotate and stop but

Use jQuery to find an event object

jQuery has wonderful selectors for DOM elements, but can you 'select' an event object. That is, if I use inline JavaScript on the onclick attribute of an elemen

Bootstrap 4 not updating onclick attribute of popover

I am trying to create a popover in bootstrap 4 with a nested button inside it, but on updating the data-content attribute of that popover with the button elemen

JQuery Get String From <img class="www.example.com">

This should be a tweak for the jQuery based image gallery "Galleria". You can click on a thumbnail div called images and it brings you on the site based on the

Modal With Another Modal Causes Scroll on Body

https://jsfiddle.net/e6x4hq9h/ Open the first modal. It opens fine. Removes the background scrollbar. Open the modal from within that modal. It causes the scr

Pass Golang Variables into Javascript

I am trying to pass my Golang variables into a Javascript file. I have read multiple articles online, including How to pass variables and data from PHP to JavaS

How to add automatically collapse/expand in content wordpress (single.php)?

There are a lot of WordPress plugins for adding collapse/expand in WordPress content, such as Collapse-O-Matic. But is there a way to add automatically collap

Select2 - use JSON as local data

I can get this to work... var options = [{id: 1, text: 'Adair, Charles'}] $('#names').select2({ data: options, }) But i cant work out how to get from h

JQuery AJAX call to SOAP Web Service - Access denied. Working in SOAP UI

JQuery AJAX call to SOAP Web Service throws exception as "Access denied". See screenshot. It is Working in SOAP UI so SOAP request seems correct. Please help in

Parsing URL hash/fragment identifier with JavaScript

Looking for a way to parse key pairs out of the hash/fragment of a URL into an object/associative array with JavaScript/JQuery

JavaScript Scale Text to Fit in Fixed Div

In JavaScript/jQuery, how can I scale a varying-length line of text inside a fixed-width Div so that the one line always fits inside the Div (as one line)?

how to destroy a function in another function javascript?

Function: function abc() { $('#table_id tr td').removeClass('highlight'); $(this).addClass('highlight'); tableText($table_label,$table_id); } abc();

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

I want add a custom Button "View Demo" next to "Add to Cart" button of WooCommerce based on Product Type, both on main shop page and single product page. I've

Hide / Unhide Cloned form elements in jQuery. How?

I can find numerous examples of Hiding and unhiding form elements in jQuery. I can also find numerous examples of cloning form elements in jQuery. But is ther

Trim to remove white space

jQuery trim not working. I wrote the following command to remove white space. Whats wrong in it? var str = $('input').val(); str = jquery.trim(str); console.l

How to use z-index in svg elements?

I'm using the svg circles in my project like this, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 120"> <g> <g id="one">

How to use z-index in svg elements?

I'm using the svg circles in my project like this, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 120"> <g> <g id="one">

How to use clipboard.js

As you may surmise from this question, I'm not very good with javascript and am trying to get clipboard.js (https://clipboardjs.com/) working but can't. I foll