Domanda

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.

È stato utile?

Soluzione 2

To get the whole thing:

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

To get the transition value, you can do:

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

Altri suggerimenti

Use jQuery.data

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

try this

var bpopup = $(".button.small.pop1").data("bpopup");
alert(bpopup);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top