J
J
Junior2015-09-27 19:14:11
css
Junior, 2015-09-27 19:14:11

How to run jQuery function via javascript?

Hello!

Please tell me if it is possible to run a function written in jQuery through javascript. There is a code (below) that should perform some action when the phone moves, I need it to start the animation on jQuery. Please tell me how to do it. Or is it possible to write this code through jQuery?

function init()
  {
    if (window.DeviceOrientationEvent) {

      window.addEventListener("deviceorientation", function(event)
      {
           // надо что-то написать { 
        }

      }, true);
    } else {
      alert("Sorry, your browser doesn't support Device Orientation");
    }
  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2015-09-27
@sim3x

https://api.jquerymobile.com/orientationchange/
or
stackoverflow.com/questions/2323281/can-js-jquery-...
and even better
mislav.uniqpath.com/2010/04/targeted-css

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question