【问题标题】:How to convert javascript code to jquery code如何将javascript代码转换为jquery代码
【发布时间】:2022-12-02 20:38:38
【问题描述】:

I need to convert this javascript code to jquery. How to do it?

`

import lightGallery from \"https://cdn.skypack.dev/lightgallery@2.0.0-beta.4\";

import lgThumbnail from \"https://cdn.skypack.dev/lightgallery@2.0.0-beta.4/plugins/thumbnail\";

const $galleryContainer = document.getElementById(\"gallery-container\");

const lg = lightGallery($galleryContainer, {
  speed: 500,
  plugins: [lgThumbnail],
  enableDrag: false,
  enableSwipe: false
});

lg.outer.on(\"click\", (e) => {
  const $item = lg.outer.find(\".lg-current .lg-image\");
  if (
    e.target.classList.contains(\"lg-image\") ||
    $item.get().contains(e.target)
  ) {
    lg.goToNextSlide();
  }
});

`

I tried to find an online converter. I managed to find a huge bunch of converters from jQuery to JS, but I need the opposite

  • What have you tried and what didn\'t work as expected? As an aside... jQuery is JavaScript, is this code failing in some way when you use it?

标签: javascript jquery converters


【解决方案1】:
【解决方案2】:
猜你喜欢
  • 1970-01-01
  • 2012-03-20
  • 1970-01-01
  • 2012-02-25
  • 1970-01-01
  • 2020-07-07
  • 2020-05-07
  • 1970-01-01
  • 2017-09-23
相关资源
最近更新 更多