0
我用下面的包裝我RoyalSliderRoyalSlider:無法訪問數據attribut
<a class="rsContent white" href="#">
<img class="rsImg" src="#" data-color="white" width="2560" height="1440">
</a>
我想檢查數據attribut的價值,爲第一rsContent所以我用下面的代碼
$('.rsContent').eq(0);
OR $('.rsContent').first();
工作正常,到目前爲止,但後來當我嘗試
$('.rsContent').eq(0).data('color');
或$('.rsContent').eq(0).attr('class');
jQuery的返回
undefined
任何想法?
我檢查日誌:未定義 – muro
似乎涉及到royalsliderplugin因爲royalsliders範圍的一切之外的工作正常。 – muro
這意味着你的代碼工作正常,除非我添加royalsliderplugin。 – muro