Re: Javascript causing CSS margin bug in IE

Tech-Archive recommends: Fix windows errors by optimizing your registry



=?Utf-8?B?TUNN?= <MCM@xxxxxxxxxxxxxxxx> wrote in
news:8B202C13-53E8-4125-A6FA-3627F1C2277D@xxxxxxxxxxxxx:

If you can get the elements with margins outside of hte update panel,
it should solve the issue. If this is impossible, you will need to
examine the source and find what is not being applied.

There is no update panel. Just a table that I am adding rows to as I
receive data in javascript.

Let me make sure I have this correct. You are peforming all of your own
AJAX transactions and not using the ASP.NET AJAX controls?

if so, you are in control of the CSS applied to elements you are
updating.

If not, you have an update panel somewhere or the AJAX would not work.
If the update panel is in a master page, this is a moot point.

One possible solution is
to switch from CSS classes to tags within classes.

..myInnerClass
{
}

becomes something like

..myClass.p
{
}


Sorry, I don't quite understand...

//CSS
..myclass1
{
}

..myclass2
{
}

<!-- tags -->
<div class="myclass1">
<div class="myclass2">
</div>
</div>


can become

//CSS
..myclass1
{
}

..myclass1.div
{
}

<!-- tags -->
<div class="myclass1">
<div>
</div>
</div>

In this way, if the inner DIV is updated, you do not have to reapply the
myclass2 class to the div. This is probably a bad example, as the
elements with classes applied (if classes are, in fact, applied) are
probably not divs.

NOTE: Hit view source and save the source. Then update with AJAX and do
it again. You can then compare the sources and find what portion of the
page needs a bit of tweaking.

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
.



Relevant Pages

  • Re: executing javascript set with innerHTML in IE 7
    ...   if ... The script is already set in the html that I'm ... returning from an Ajax call and it needs to run inside the div that I ...
    (comp.lang.javascript)
  • Re: div as big as the document
    ... place the dialog (another div) on the top of this one, ... It's certainly got cross-browser Ajax ... bad scripts can't help you ...
    (comp.lang.javascript)
  • Attempting to access a dynamically created div
    ... static div using ajax. ... Each answer is itself in a div. ... The autosuggest part isn't important, ... which produce such suggestion lists are dynamically added and numerous ...
    (comp.lang.javascript)
  • Re: innerHTML with AJAX problem
    ... In a page I insert some HTML with a DIV by AJAX. ... var ajaxRequest; // The variable that makes Ajax possible! ...
    (comp.lang.javascript)
  • Re: Cant figure out ajax/php problem.
    ... display an alert make the DIV visible via CSS. ... Well I have a DIV that messages display in that is refreshed via ajax every ... it in my PHP script that is being called by AJAX. ...
    (comp.lang.php)