admin管理员组文章数量:1391818
Since I cannot search for this with meaningful results, I can't be sure that this is not a duplicate.
However, I am running a JSSOR Slider on my site and some of the elements have a u property for example:
<div u="slides" style="cursor: move;
position: absolute; left: 0px; top: 0px; width:
1300px; height: 500px; overflow: hidden;">
This "u=slides" is throwing up an error when I run it through a W3 Validator, however when I remove this property from the element, the slider no longer functions.
I am wondering the purpose of this property as I see no markup for it anywhere, and wondering if it can be substituted for anything in order to make the site pass markup validation.
Thanks in advance.
Since I cannot search for this with meaningful results, I can't be sure that this is not a duplicate.
However, I am running a JSSOR Slider on my site and some of the elements have a u property for example:
<div u="slides" style="cursor: move;
position: absolute; left: 0px; top: 0px; width:
1300px; height: 500px; overflow: hidden;">
This "u=slides" is throwing up an error when I run it through a W3 Validator, however when I remove this property from the element, the slider no longer functions.
I am wondering the purpose of this property as I see no markup for it anywhere, and wondering if it can be substituted for anything in order to make the site pass markup validation.
Thanks in advance.
Share Improve this question edited Aug 19, 2014 at 11:56 James Donnelly 129k35 gold badges215 silver badges223 bronze badges asked Aug 19, 2014 at 11:45 Richard GrandiRichard Grandi 472 silver badges7 bronze badges 3- 1 Maybe it's used somewhere in javascript? – u_mulder Commented Aug 19, 2014 at 11:47
- ok what is your issue? – cracker Commented Aug 19, 2014 at 11:47
- 2 use a slider plugin that doesn't rely on invalid custom attributes. – Bergi Commented Aug 19, 2014 at 11:47
1 Answer
Reset to default 8Custom attributes (in HTML5) can be assigned to elements using the data-*
prefix:
<elem data-u="slides"></elem>
The problem here, however, is that whoever developed this JSSOR Slider plugin has decided not to use valid HTML5 markup. Unless the plugin's JavaScript code is modified to look for a data-*
attribute rather than an invalid attribute named "u", you will not be able to modify this attribute without breaking the way your site functions.
Update: Digging deeper I've discovered that this was already raised as an issue on JSSOR's GitHub repository back in January: https://github./jssor/jquery-slider/issues/4. They've rectified this by allowing you to use a valid data-u
attribute instead of u
.
The Solution
Provided your JSSOR plugin code is up to date. You can simply modify your HTML to:
<div data-u="slides" style="...">
本文标签: javascriptquotuquot property within an elementStack Overflow
版权声明:本文标题:javascript - "u" property within an element - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744686104a2619708.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论