Having Issue on Using Data Attributes with jQuery and Raphaël.js
Can you please take a look at
This Demo
and let me know why I am getting following errors while I can get access to `data-prov` by using the ` var prov = $(this).data("prov");`
This works when I hard code the snippet like:
- $(this).hover(function(){
- BC.attr({fill: "#ccc" });
- }, function(){
- BC.attr({fill: "#000" });
- });
but using the
- jQuery('ul li').each(function(){
- var prov = $(this).data("prov");
- $(this).hover(function(){
- console.log(prov);
- prov.attr({fill: "#ccc" });
- }, function(){
- prov.attr({fill: "#ccc" });
- });
- });
is causing the errors. As you can see the console is logging the correct value of the list but why the error is happening?!
Thanks