Giter Site home page Giter Site logo

how to flip card from js code about card HOT 7 CLOSED

darkworks avatar darkworks commented on June 8, 2024
how to flip card from js code

from card.

Comments (7)

melloware avatar melloware commented on June 8, 2024 1

If your CVC input field is id="cvc" for example you can flip the card like this...

document.querySelector('#cvc').dispatchEvent(new Event('focus'));

from card.

darkworks avatar darkworks commented on June 8, 2024

thanks :)

from card.

darkworks avatar darkworks commented on June 8, 2024

@melloware one more question , can u tell how to change color of the card via js like by setting custom hex color ?
i tried but no success
jQuery(".jp-card-back:before").attr('style','background-color:'+color);
thanks

from card.

melloware avatar melloware commented on June 8, 2024

That I am not sure of with jquery as the cards are all rendered with some complex CSS so you might have to dig into it.

from card.

darkworks avatar darkworks commented on June 8, 2024

That I am not sure of with jquery as the cards are all rendered with some complex CSS so you might have to dig into it.

ya i checked sad thing is that annoying :before is used which is very hard to modify on runtime is its not part of dom :(

.jp-card.jp-card-visa.jp-card-identified .jp-card-front:before, .jp-card.jp-card-visa.jp-card-identified .jp-card-back:before {
    background-color: #191278;
}

is it possible to change this color to normal css class instead of :before or ;after so that it give us devs control to set credit color as we like

thanks

from card.

melloware avatar melloware commented on June 8, 2024

I didn't design this library but changing all the cards now seem like a task that is not going to be done unless you make the changes and submit a PR

from card.

darkworks avatar darkworks commented on June 8, 2024

I didn't design this library but changing all the cards now seem like a task that is not going to be done unless you make the changes and submit a PR

ok right i will play with it to see how it goes

from card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.