Quantcast
Channel: Internet Explorer 8, 9, 10, 11 forum
Viewing all articles
Browse latest Browse all 10469

Problems with display none in ie

$
0
0

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




Viewing all articles
Browse latest Browse all 10469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>