반응형

jQuery 데이터 속성 값을 기반으로 요소를 찾는 방법은 무엇입니까?

jQuery how to find an element based on a data-attribute value?

 

jQuery how to find an element based on a data-attribute value?

I've got the following scenario: var el = 'li'; and there are 5

  • 's on the page each with a data-slide=number attribute (number being 1,2,3,4,5 respectively). I now need to find the cur...

     

    stackoverflow.com

I've got the following scenario:

var el = 'li';

and there are 5 <li>'s on the page each with a data-slide=number attribute (number being 1,2,3,4,5 respectively).

I now need to find the currently active slide number which is mapped to var current = $('ul').data(current); and is updated on each slide change.

So far my tries have been unsuccessful, trying to construct the selector that would match the current slide:

$('ul').find(el+[data-slide=+current+]);

does not match/return anything…

The reason I can't hardcode the li part is that this is a user accessible variable that can be changed to a different element if required, so it may not always be an li.

반응형
반응형

Dreampie1.1.1 & Python 3.2 이상  실행시 UTF-8 어쩌고 하는 에러 발생시

attribute Error가 발생하면.

 

 

D:\DreamPie\share\dreampie\subp_main.py

의 30번 행을 수정하라.

 

AS-IS

sys.setdefaultencoding('utf-8')

 

TO-BE

if sys.version_info[0] < 3:

    sys.setdefaultencoding('utf-8')

 

 

 

반응형

+ Recent posts