문제

this is my code:

<span class="button small pop1" data-bpopup='{"transition":"slideDown","speed":850,"easing":"easeOutBack"}'>Pop it up</span>

How can I get data-bopopup attribute with jQuery?

Thanks a lot.

도움이 되었습니까?

해결책 2

To get the whole thing:

$('.button').data('bpopup')

To get the transition value, you can do:

$('.button').data('bpopup').transition;

다른 팁

Use jQuery.data

var bpopup = $(".button.small.pop1").data("bpopup");

try this

var bpopup = $(".button.small.pop1").data("bpopup");
alert(bpopup);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top