Data-filter连接在jQuery中的HTML代码

huangapple go评论103阅读模式
英文:

Data-filter connection in jQuery with HTML code

问题

Here is the translated code you requested:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->
const pagiselector = document.querySelector(".portfolio__filter__pagi");

function test(totalPages, page) {
  let pagicode = "";
  let beforePage = page - 1;
  let afterPage = page + 1;
  let activeLi = "";
  let totalP = totalPages;

  if (page > 1) {
    pagicode += `<a href="#" onclick="test(${totalP}, ${page - 1})" class="arrow__pagination left__arrow" data-filter=".pagi-${page - 1}"><li>
                <span class="arrow_left"></span> Prev</li></a>`;
  }
  if (page > 2) {
    pagicode += `<a href="#" onclick="test(${totalP}, ${1})" class="number__pagination filter" data-filter=".pagi-${1}"><li>1</li></a>`;
  }
  pagiselector.innerHTML = pagicode;
}

<!-- language: lang-html -->
<section class="portfolio spad">
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <ul class="portfolio__filter">
          <li class="active" data-filter=".pagi-1">
            All
          </li>
          <li data-filter=".photo">
            Photo
          </li>
          <li data-filter=".photo_1">
            Photo_1
          </li>
          <li data-filter=".photo_2">
            Photo_2
          </li>
          <li data-filter=".photo_3">
            Photo_3
          </li>
        </ul>
      </div>
    </div>
    <div class="row portfolio__gallery">
      <div class="col-lg-4 col-md-6 col-sm-6 mix pagi-1 photo">
        <div class="portfolio__item">
          <div class="portfolio__item__video set-bg lazyloaded" data-setbg="<!-- image -->">
            <a href="<!-- image -->" class="play-btn" data-lbwps-width="480" data-lbwps-height="720" data-lbwps-srcsmall="<!-- image -->"><i class="fa fa-camera"></i></a>
          </div>
          <div class="portfolio__item__text">
            <h4>
              image
            </h4>
            <ul>
              <li>
                portfolio
              </li>
              <li>
                Photo
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="col-lg-4 col-md-6 col-sm-6 mix pagi-1 photo_1">
        <div class="portfolio__item">
          <div class="portfolio__item__video set-bg lazyloaded" data-setbg="<!-- image -->">
            <a href="<!-- image -->" class="play-btn" data-lbwps-width="480" data-lbwps-height="720" data-lbwps-srcsmall="<!-- image -->"><i class="fa fa-camera"></i></a>
          </div>
          <div class="portfolio__item__text">
            <h4>
              image
            </h4>
            <ul>
              <li>
                portfolio
              </li>
              <li>
                Photo_1
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="col-lg-4 col-md-6 col-sm-6 mix pagi-2 photo_1">
        <div class="portfolio__item">
          <div class="portfolio__item__video set-bg lazyloaded" data-setbg="<!-- image -->">
            <a href="<!-- image -->" class="play-btn" data-lbwps-width="480" data-lbwps-height="720" data-lbwps-srcsmall="<!-- image -->"><i class="fa fa-camera"></i></a>
          </div>
          <div class="portfolio__item__text">
            <h4>
              image
            </h4>
            <ul>
              <li>
                portfolio
              </li>
              <li>
                Photo_1
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="col-lg-4 col-md-6 col-sm-6 mix pagi-3 photo_2">
        <div class="portfolio__item">
          <div class="portfolio__item__video set-bg lazyloaded" data-setbg="<!-- image -->">
            <a href="<!-- image -->" class="play-btn" data-lbwps-width="480" data-lbwps-height="720" data-lbwps-srcsmall="<!-- image -->"><i class="fa fa-camera"></i></a>
          </div>
          <div class="portfolio__item__text">
            <h4>
              image
            </h4>
            <ul>
              <li>
                portfolio
              </li>
              <li>
                Photo_2
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="col-lg-4 col-md-6 col-sm-6 mix pagi-6 photo_3">
        <div class="portfolio__item">
          <div class="portfolio__item__video set-bg lazyloaded" data-setbg="<!-- image -->">
            <a href="<!-- image -->" class="play-btn" data-lbwps-width="480" data-lbwps-height="720" data-lbwps-srcsmall="<!-- image -->"><i class="fa fa-camera"></i></a>
          </div>
          <div class="portfolio__item__text">
            <h4>
              image
            </h4>
            <ul>
              <li>
                portfolio
              </li>
              <li>
                Photo_3
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <!-- function pagination code 
    <ul class="portfolio__filter__pagi">
      <li class="number__pagination" data-filter=".pagi-1">1</li>
      <li class="number__pagination" data-filter=".pagi-2">2</li>
      <li class="number__pagination" data-filter=".pagi-3">3</li>
      <li class="number__pagination" data-filter=".pagi-6">6</li>
    </ul>
    -->
    <!-- js pagination code -->
    <ul class="portfolio__filter__pagi">
      <!-- 
      <a href="#" onclick="test(6,1)" class="arrow__pagination left__arrow" data-filter=".pagi-1"><li>
        <span class="arrow_left"></span> Prev</li></a>
      <a href="#" onclick="test(6,1)" class="number__pagination" data-filter=".pagi-1"><li>2</li></a>
      <a href="#" onclick="test(6,2)" class="number__pagination

<details>
<summary>英文:</summary>



&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;

&lt;!-- language: lang-js --&gt;

    const pagiselector = document.querySelector(&quot;.portfolio__filter__pagi&quot;);

    function test(totalPages, page) {
      let pagicode = &quot;&quot;;
      let beforePage = page - 1;
      let afterPage = page + 1;
      let activeLi = &quot;&quot;;
      let totalP = totalPages;


      if (page &gt; 1) {
        pagicode += `&lt;a href=&quot;#&quot; onclick=&quot;test(${totalP}, ${page - 1})&quot; class=&quot;arrow__pagination left__arrow&quot; data-filter=&quot;.pagi-${page - 1}&quot;&gt;&lt;li&gt;
                    &lt;span class=&quot;arrow_left&quot;&gt;&lt;/span&gt; Prev&lt;/li&gt;&lt;/a&gt;`;
                        
      }
      if (page &gt; 2) {
        pagicode += `&lt;a href=&quot;#&quot; onclick=&quot;test(${totalP}, ${1})&quot; class=&quot;number__pagination filter&quot; data-filter=&quot;.pagi-${1}&quot;&gt;&lt;li&gt;1&lt;/li&gt;&lt;/a&gt;`;

    }
      pagiselector.innerHTML = pagicode;

    }

&lt;!-- language: lang-html --&gt;

    &lt;section class=&quot;portfolio spad&quot;&gt;
    	&lt;div class=&quot;container&quot;&gt;
    		&lt;div class=&quot;row&quot;&gt;
    			&lt;div class=&quot;col-lg-12&quot;&gt;
    				&lt;ul class=&quot;portfolio__filter&quot;&gt;
    					&lt;li class=&quot;active&quot; data-filter=&quot;.pagi-1&quot;&gt;
    						All
    					&lt;/li&gt;
    					&lt;li data-filter=&quot;.photo&quot;&gt;
    						Photo
    					&lt;/li&gt;
    					&lt;li data-filter=&quot;.photo_1&quot;&gt;
    						Photo_1
    					&lt;/li&gt;
    					&lt;li data-filter=&quot;.photo_2&quot;&gt;
    						Photo_2
    					&lt;/li&gt;
    					&lt;li data-filter=&quot;.photo_3&quot;&gt;
    						Photo_3
    					&lt;/li&gt;
    				&lt;/ul&gt;
    			&lt;/div&gt;
    		&lt;/div&gt;
    		&lt;div class=&quot;row portfolio__gallery&quot;&gt;
    			&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-1 photo&quot;&gt;
    				&lt;div class=&quot;portfolio__item&quot;&gt;
    					&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
    						&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
    					&lt;/div&gt;
    					&lt;div class=&quot;portfolio__item__text&quot;&gt;
    						&lt;h4&gt;
    							image
    						&lt;/h4&gt;
    						&lt;ul&gt;
    							&lt;li&gt;
    								portfolio
    							&lt;/li&gt;
    							&lt;li&gt;
    								Photo
    							&lt;/li&gt;
    						&lt;/ul&gt;
    					&lt;/div&gt;
    				&lt;/div&gt;
    			&lt;/div&gt;
    			&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-1 photo_1&quot;&gt;
    				&lt;div class=&quot;portfolio__item&quot;&gt;
    					&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
    						&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
    					&lt;/div&gt;
    					&lt;div class=&quot;portfolio__item__text&quot;&gt;
    						&lt;h4&gt;
    							image
    						&lt;/h4&gt;
    						&lt;ul&gt;
    							&lt;li&gt;
    								portfolio
    							&lt;/li&gt;
    							&lt;li&gt;
    								Photo_1
    							&lt;/li&gt;
    						&lt;/ul&gt;
    					&lt;/div&gt;
    				&lt;/div&gt;
    			&lt;/div&gt;
    			&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-2 photo_1&quot;&gt;
    				&lt;div class=&quot;portfolio__item&quot;&gt;
    					&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
    						&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
    					&lt;/div&gt;
    					&lt;div class=&quot;portfolio__item__text&quot;&gt;
    						&lt;h4&gt;
    							image
    						&lt;/h4&gt;
    						&lt;ul&gt;
    							&lt;li&gt;
    								portfolio
    							&lt;/li&gt;
    							&lt;li&gt;
    								Photo_1
    							&lt;/li&gt;
    						&lt;/ul&gt;
    					&lt;/div&gt;
    				&lt;/div&gt;
    			&lt;/div&gt;
    			&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-3 photo_2&quot;&gt;
    				&lt;div class=&quot;portfolio__item&quot;&gt;
    					&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
    						&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
    					&lt;/div&gt;
    					&lt;div class=&quot;portfolio__item__text&quot;&gt;
    						&lt;h4&gt;
    							image
    						&lt;/h4&gt;
    						&lt;ul&gt;
    							&lt;li&gt;
    								portfolio
    							&lt;/li&gt;
    							&lt;li&gt;
    								Photo_2
    							&lt;/li&gt;
    						&lt;/ul&gt;
    					&lt;/div&gt;
    				&lt;/div&gt;
    			&lt;/div&gt;
    			&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-6 photo_3&quot;&gt;
    				&lt;div class=&quot;portfolio__item&quot;&gt;
    					&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
    						&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
    					&lt;/div&gt;
    					&lt;div class=&quot;portfolio__item__text&quot;&gt;
    						&lt;h4&gt;
    							image
    						&lt;/h4&gt;
    						&lt;ul&gt;
    							&lt;li&gt;
    								portfolio
    							&lt;/li&gt;
    							&lt;li&gt;
    								Photo_3
    							&lt;/li&gt;
    						&lt;/ul&gt;
    					&lt;/div&gt;
    				&lt;/div&gt;
    			&lt;/div&gt;
    		&lt;/div&gt;
    		&lt;!-- function pagination code 
        &lt;ul class=&quot;portfolio__filter__pagi&quot;&gt;
    		&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-1&quot;&gt;1&lt;/li&gt;
    		&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-2&quot;&gt;2&lt;/li&gt;
    		&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-3&quot;&gt;3&lt;/li&gt;
    		&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-6&quot;&gt;6&lt;/li&gt;
    		&lt;/ul&gt;
    		--&gt;
    		&lt;!-- js pagination code --&gt;
    		&lt;ul class=&quot;portfolio__filter__pagi&quot;&gt;
    			&lt;!-- 
          &lt;a href=&quot;#&quot; onclick=&quot;test(6,1)&quot; class=&quot;arrow__pagination left__arrow&quot; data-filter=&quot;.pagi-1&quot;&gt;&lt;li&gt;
    			&lt;span class=&quot;arrow_left&quot;&gt;&lt;/span&gt; Prev&lt;/li&gt;&lt;/a&gt;
    			&lt;a href=&quot;#&quot; onclick=&quot;test(6,1)&quot; class=&quot;number__pagination&quot; data-filter=&quot;.pagi-1&quot;&gt;&lt;li&gt;2&lt;/li&gt;&lt;/a&gt;
    			&lt;a href=&quot;#&quot; onclick=&quot;test(6,2)&quot; class=&quot;number__pagination active&quot; data-filter=&quot;.pagi-2&quot;&gt;&lt;li&gt;2&lt;/li&gt;&lt;/a&gt;
    			--&gt;
    		&lt;/ul&gt;

&lt;!-- end snippet --&gt;

I asked the wrong question here, so I&#39;ll try to ask it differently. I would like to create a page navigation using javascript and Data-filter.
In the html code, the data-filter works perfectly, but when used in javascript, the Data-filter function only runs once when the TEST link is clicked. After another click, the function will no longer start.
So how should I modify the code (if possible) so that the Data-filter works outside of javascript? I would like to preserve the structure of the js code.

Text += &lt;a href=&quot;#&quot; class=&quot;number&quot; data-filter=&quot;.text&quot; onClick=&quot;test(1, 1)&quot;&gt;Test&lt;/a&gt;;


&lt;div class=&quot;text&quot;&gt;Text&lt;/div&gt;
&lt;div class=&quot;text1&quot;&gt;Text&lt;/div&gt;

<script>
function test(test1, test2) {
let Text = "";
Text += &lt;a href=&quot;#&quot; class=&quot;number&quot; data-filter=&quot;.text&quot; onClick=&quot;test(1, 1)&quot;&gt;Test&lt;/a&gt; ;
Text += &lt;a href=&quot;#&quot; class=&quot;number&quot; data-filter=&quot;.text1&quot; onClick=&quot;test(1, 1)&quot;&gt;Test1&lt;/a&gt;;
code.innerHTML = Text;
}


</details>
# 答案1
**得分**: 0
不要翻译代码部分,以下是翻译好的内容:
Instead of add `onclick=&quot;test(${totalP}, ${1})&quot;` use [`addEventListener`][1] to bind the click event to your target element after you append your pagination. See the following example.
改用 [`addEventListener`][1] 来绑定点击事件到您的目标元素,而不是使用 `onclick=&quot;test(${totalP}, ${1})&quot;`,在您附加分页后进行绑定。请参考以下示例。
<details>
<summary>英文:</summary>
Instead of add `onclick=&quot;test(${totalP}, ${1})&quot;` use [`addEventListener`][1] to bind the click event to your target element after you append your pagination. See the following example.
&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;
&lt;!-- language: lang-js --&gt;
const pagiselector = document.querySelector(&quot;.portfolio__filter__pagi&quot;);
function test(totalPages, page) {
let pagicode = &quot;&quot;;
let beforePage = page - 1;
let afterPage = page + 1;
let activeLi = &quot;&quot;;
let totalP = totalPages;
if (page &gt; 1) {
pagicode += `&lt;a href=&quot;#&quot; onclick=&quot;test(${totalP}, ${page - 1})&quot; class=&quot;arrow__pagination left__arrow&quot; data-filter=&quot;.pagi-${page - 1}&quot;&gt;&lt;li&gt;
&lt;span class=&quot;arrow_left&quot;&gt;&lt;/span&gt; Prev&lt;/li&gt;&lt;/a&gt;`;
}
if (page &gt; 2) {
pagicode += `&lt;a href=&quot;#&quot; onclick=&quot;test(${totalP}, ${1})&quot; class=&quot;number__pagination filter&quot; data-filter=&quot;.pagi-${1}&quot;&gt;&lt;li&gt;1&lt;/li&gt;&lt;/a&gt;`;
}
}
let pagiHtml = &quot;&quot;;
for (let i = 0; i &lt; 6; i++) {
pagiHtml += `&lt;a href=&quot;#&quot; class=&quot;number__pagination filter&quot; data-i=&quot;${i}&quot; data-filter=&quot;.pagi-${i}&quot;&gt;&lt;li&gt;${i}&lt;/li&gt;&lt;/a&gt;`
}
pagiselector.innerHTML = pagiHtml;
let anchorsTags = pagiselector.getElementsByTagName(&quot;a&quot;);
for (var i = 0; i &lt; anchorsTags.length; i++) {
anchorsTags[i].addEventListener(&quot;click&quot;, myFunction, false);
}
function myFunction(event) {
event.preventDefault();
console.log(this.getAttribute(&#39;data-i&#39;));
// Your logic here
//test(totalPages, page)
}
&lt;!-- language: lang-html --&gt;
&lt;section class=&quot;portfolio spad&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-lg-12&quot;&gt;
&lt;ul class=&quot;portfolio__filter&quot;&gt;
&lt;li class=&quot;active&quot; data-filter=&quot;.pagi-1&quot;&gt;
All
&lt;/li&gt;
&lt;li data-filter=&quot;.photo&quot;&gt;
Photo
&lt;/li&gt;
&lt;li data-filter=&quot;.photo_1&quot;&gt;
Photo_1
&lt;/li&gt;
&lt;li data-filter=&quot;.photo_2&quot;&gt;
Photo_2
&lt;/li&gt;
&lt;li data-filter=&quot;.photo_3&quot;&gt;
Photo_3
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;row portfolio__gallery&quot;&gt;
&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-1 photo&quot;&gt;
&lt;div class=&quot;portfolio__item&quot;&gt;
&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;portfolio__item__text&quot;&gt;
&lt;h4&gt;
image
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
portfolio
&lt;/li&gt;
&lt;li&gt;
Photo
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-1 photo_1&quot;&gt;
&lt;div class=&quot;portfolio__item&quot;&gt;
&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;portfolio__item__text&quot;&gt;
&lt;h4&gt;
image
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
portfolio
&lt;/li&gt;
&lt;li&gt;
Photo_1
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-2 photo_1&quot;&gt;
&lt;div class=&quot;portfolio__item&quot;&gt;
&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;portfolio__item__text&quot;&gt;
&lt;h4&gt;
image
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
portfolio
&lt;/li&gt;
&lt;li&gt;
Photo_1
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-3 photo_2&quot;&gt;
&lt;div class=&quot;portfolio__item&quot;&gt;
&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;portfolio__item__text&quot;&gt;
&lt;h4&gt;
image
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
portfolio
&lt;/li&gt;
&lt;li&gt;
Photo_2
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-lg-4 col-md-6 col-sm-6 mix pagi-6 photo_3&quot;&gt;
&lt;div class=&quot;portfolio__item&quot;&gt;
&lt;div class=&quot;portfolio__item__video set-bg lazyloaded&quot; data-setbg=&quot;&lt;!-- image --&gt;&quot;&gt;
&lt;a href=&quot;&lt;!-- image --&gt;&quot; class=&quot;play-btn&quot; data-lbwps-width=&quot;480&quot; data-lbwps-height=&quot;720&quot; data-lbwps-srcsmall=&quot;&lt;!-- image --&gt;&quot;&gt;&lt;i class=&quot;fa fa-camera&quot;&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;portfolio__item__text&quot;&gt;
&lt;h4&gt;
image
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
portfolio
&lt;/li&gt;
&lt;li&gt;
Photo_3
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- function pagination code 
&lt;ul class=&quot;portfolio__filter__pagi&quot;&gt;
&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-1&quot;&gt;1&lt;/li&gt;
&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-2&quot;&gt;2&lt;/li&gt;
&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-3&quot;&gt;3&lt;/li&gt;
&lt;li class=&quot;number__pagination&quot; data-filter=&quot;.pagi-6&quot;&gt;6&lt;/li&gt;
&lt;/ul&gt;
--&gt;
&lt;!-- js pagination code --&gt;
&lt;ul class=&quot;portfolio__filter__pagi&quot;&gt;
&lt;!-- 
&lt;a href=&quot;#&quot; onclick=&quot;test(6,1)&quot; class=&quot;arrow__pagination left__arrow&quot; data-filter=&quot;.pagi-1&quot;&gt;&lt;li&gt;
&lt;span class=&quot;arrow_left&quot;&gt;&lt;/span&gt; Prev&lt;/li&gt;&lt;/a&gt;
&lt;a href=&quot;#&quot; onclick=&quot;test(6,1)&quot; class=&quot;number__pagination&quot; data-filter=&quot;.pagi-1&quot;&gt;&lt;li&gt;2&lt;/li&gt;&lt;/a&gt;
&lt;a href=&quot;#&quot; onclick=&quot;test(6,2)&quot; class=&quot;number__pagination active&quot; data-filter=&quot;.pagi-2&quot;&gt;&lt;li&gt;2&lt;/li&gt;&lt;/a&gt;
--&gt;
&lt;/ul&gt;
&lt;!-- end snippet --&gt;
[1]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
</details>

huangapple
  • 本文由 发表于 2023年8月10日 16:52:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76874112.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定