Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery文档方向_Jquery_Css - Fatal编程技术网

jquery文档方向

jquery文档方向,jquery,css,Jquery,Css,我在头部有块,包含以下内容: *, body { direction:rtl; } 我注意到jQuery的dir变量设置为ltr: $(function(){ alert(this.dir); }); 有没有办法检索具体的页面方向 谢谢试试: alert($('body').attr('dir')); 祝你好运 试试看: alert($('body').attr('dir')); $('body').css('direction') 祝你好运 $('body').css('dir

我在头部有块,包含以下内容:

*, body { direction:rtl; }
我注意到jQuery的dir变量设置为ltr:

$(function(){
   alert(this.dir); });
有没有办法检索具体的页面方向

谢谢

试试:

alert($('body').attr('dir'));
祝你好运

试试看:

alert($('body').attr('dir'));
$('body').css('direction')
祝你好运

$('body').css('direction')
阅读更多关于


阅读更多关于的内容在CSS中,您使用的是
方向
,但在jQuery代码中,您是通过
dir
获取它的。您也需要在CSS中使用
dir
来获得正确的值。

在CSS中,您使用的是
方向
,但在jQuery代码中,您通过
dir
获取它。您还需要在CSS中使用
dir
来获得正确的值。

如果在HTML中设置了
dir
属性,则会获得该属性,但您可能在
direction
属性中安装了该属性,例如,它可能是从
继承的。如果在HTML中设置了
dir
属性,则会获取该属性,但您可能是在
direction
属性中安装的,该属性可能是从
继承的。