ie中没有显示的问题 [英] Problems with display none in ie

查看:74
本文介绍了ie中没有显示的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个wordpress插件,当用户进入页面时运行wp_update_post,然后在第二次加载时页面显示更新的内容。在页面上是带有样式显示的div元素:none由php生成。现在当我使用Internet
Explore并且第二次加载页面时,元素没有样式显示:none它不在源代码中。如果我使用firefox加载页面,则html源中的显示无正确。如果我加载ie即使我切换到firefox元素
然后卡在页面上,无论如何。但是,如果我使用firefox加载页面,即使我切换到Internet Explorer,元素也没有正确显示。如果我强制他们使用javascript显示任何一个,它们是不可见的,但显示没有
不会显示为divs样式属性的一部分。当调用显示块时,它们不会再出现。我的问题是,这是由互联网浏览器引起的,我无法以某种方式解决?这个显示以后没有设置以后由Internet Explorer修复?
或者我必须找到解决问题的方法谢谢*编辑


*编辑它看起来像google chrome也这样做。 onmouseover也从php
生成的所有元素中删除。


这里是我的php看起来像


$结果="。< A HREF = '#' ID = '" $文本$ Y" M"。"' 的onmouseover ='弹出(\"" 。$ text。$ y。" \",event)'>"。$ text。"< / a>英寸;

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; $ ar = $ this-> Amazon_Popup($ text,$ this-> ar [$ text。" Amazon"]);

       &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;如果(strlen的($ AR [1])> 80){

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; $ popup_content。="< div class = \" a \"风格= \" z索引:1;文本对齐:中心;显示:无;宽度:250像素;高度:200像素;背景颜色:白色;边框样式:固体;边框宽度:1px的; \ "
id = \""。$ text。$ y。" \">< div id = \""。$ text。$ y。" close"。 " \"风格= \"显示:无; \"类= \" close\"的onclick = \" closePopup(QUOT;。$文本$ Y")\">< / DIV>< DIV ID = \""。$文本$ Y" ;箭头"。" \"
style = \" diplay:none; \"类= \" arrow\">< / DIV>< DIV类= \" popuptext\">" $ AR [0]"。< / DIV> < / DIV>英寸;

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; }

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;否则if(strlen($ ar [1])> 60){

              &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; $ popup_content。="< div class = \" a \"风格= \" z索引:1;文本对齐:中心;显示:无;宽度:250像素;高度:150像素;背景颜色:白色;边框样式:固体;边框宽度:1px的; \ "
id = \""。$ text。$ y。" \">< div id = \""。$ text。$ y。" close"。 " \"风格= \"显示:无; \"类= \" close\"的onclick = \" closePopup(QUOT;。$文本$ Y")\">< / DIV>< DIV ID = \""。$文本$ Y" ;箭头"。" \"
style = \" diplay:none; \"类= \" arrow\">< / DIV>< DIV类= \" popuptext\">" $ AR [0]"。< / DIV> < / DIV>英寸;

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; }

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;否则{

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; $ popup_content。="< div class = \" a \"风格= \" z索引:1;文本对齐:中心;显示:无;宽度:250像素;高度:100像素;背景颜色:白色;边框样式:固体;边框宽度:1px的; \ "
id = \""。$ text。$ y。" \">< div id = \""。$ text。$ y。" close"。 " \"风格= \"显示:无; \"类= \" close\"的onclick = \" closePopup(QUOT;。$文本$ Y")\">< / DIV>< DIV ID = \""。$文本$ Y" ;箭头"。" \"
style = \" diplay:none; \"类= \" arrow\">< / DIV>< DIV类= \" popuptext\">" $ AR [0]"。< / DIV> < / DIV>英寸;

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; }

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;返回数组($ result,$ popup_content);



alos如果我将结果设为一个名为a的类并设置css显示没有元素消失。如果我r =引用一个在jquery中正确显示none的元素之一 像这样


$(" a")。each(function(){

       ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; VAR X = FALSE;

&NBSP;                        // alert($(此)的.html());

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; $。每个(this.attributes,功能(I,ATTRIB){

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;变种名称= attrib.name;

                             var value = attrib.value;

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;如果(值=="#"){

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NB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;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; });

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP; }

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; });



元素完全从源代码中消失完全奇怪虽然iuf firefox用于在任何其他之前第一次加载页面浏览器的代码在firefox Internet Explorer和谷歌浏览器中运行良好,但如果首先使用chrome或ie
则在所有三种浏览器中都会失败。

解决方案

http ://en.support.wordpress.com/


IE11中的兼容性更改


I have a wordpress plugin that runs wp_update_post when the user goes to a page, then on the second load the page displays the updated content. On the page are div elements with the styling display:none that are generated by php. Now when I am using Internet Explore and the page load the second time, the elements do not have the styling display:none it is not in the source. if I use firefox to load the page the display none is properly in the html source. If i load with ie even if i switch to firefox the elements are then stuck on the page no matter what. However if i use firefox to load the page the elements have display none correctly even if i switch to internet explorer. If I force them to display none using javascript, they are invisible, but display none does not show up as part of the divs style attribute. And when display block is called they do not reappear. My question is, is this something caused by internet explorer that i cannot fix somehow? will this display none setting later be fixed by internet explorer? or will i have to find some way to work around the problem thanks*edit

*edit it looks like google chrome also does this. also onmouseover is removed from all of the elements that are generated by php

here is what my php looks like

$result .= "<a href='#' id='".$text.$y."m"."' onmouseover='popup(\"".$text.$y."\", event)'>".$text."</a> ";
                            $ar = $this->Amazon_Popup($text, $this->ar[$text."Amazon"]);
                            if (strlen($ar[1]) > 80) {
                                $popup_content .= "<div class=\"a\" style=\"z-index:1;text-align:center;display:none;width:250px;height:200px;background-color:white;border-style:solid;border-width:1px;\" id=\"".$text.$y."\"><div id=\"".$text.$y."close"."\" style=\"display:none;\" class=\"close\" onclick=\"closePopup(".$text.$y.")\"></div><div id=\"".$text.$y."arrow"."\" style=\"diplay:none;\" class=\"arrow\"></div><div class=\"popuptext\">".$ar[0]."</div></div>";
                            }
                            else if (strlen($ar[1]) > 60) {
                                $popup_content .= "<div class=\"a\" style=\"z-index:1;text-align:center;display:none;width:250px;height:150px;background-color:white;border-style:solid;border-width:1px;\" id=\"".$text.$y."\"><div id=\"".$text.$y."close"."\" style=\"display:none;\" class=\"close\" onclick=\"closePopup(".$text.$y.")\"></div><div id=\"".$text.$y."arrow"."\" style=\"diplay:none;\" class=\"arrow\"></div><div class=\"popuptext\">".$ar[0]."</div></div>";
                            }
                            else {
                                $popup_content .= "<div class=\"a\" style=\"z-index:1;text-align:center;display:none;width:250px;height:100px;background-color:white;border-style:solid;border-width:1px;\" id=\"".$text.$y."\"><div id=\"".$text.$y."close"."\" style=\"display:none;\" class=\"close\" onclick=\"closePopup(".$text.$y.")\"></div><div id=\"".$text.$y."arrow"."\" style=\"diplay:none;\" class=\"arrow\"></div><div class=\"popuptext\">".$ar[0]."</div></div>";
                            }
                            return array($result, $popup_content);

alos if i make result a class called a and set css display none the elements disappear. if i r=make a reference to one of the elements that are properly displaying none in jquery  like so

$("a").each( function() {
                        var x = false;
                        //alert($(this).html());
                        $.each(this.attributes, function(i, attrib){
                            var name = attrib.name;
                            var value = attrib.value;
                            if (value == "#") {
                                x = true;
                            }
                         });
                         if (x == true) {
                             n = $(this).html();
                             
                             $(this).mouseover( function() {
                                 alert("hello");
                                 //$(this).attr('id'))
                                 var d = document.getElementById("surveys3"); <<<<<<<<<right here
                                 d.style.display = "block";
                             });
                         }
                    });

the element vanishes from the source code entirely oddly though iuf firefox is used to load the page the very first time before any other browser does the code works fine in firefox internet explorer and google chrome, but if chrome or ie are used first it fails in all three browsers

解决方案

http://en.support.wordpress.com/

Compatibility changes in IE11


这篇关于ie中没有显示的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆