it seems when use jquery's addclass
function adding class 2px border, returns old value @ times , not new when outputting css in iframe. assume happens due how fast class gets added. example:
stylesheet:
.testborder { border: 2px solid #000; }
javascript:
var iframe = $('#contentframe').contents(); var obj = $('#someobj',iframe); obj.addclass('testborder'); console.log(obj.css('border-top-width')); console.log(obj.css('border-left-width'));
the border values outputted 0 instead of 2px. can like:
obj.delay(500).queue(function(){ console.log($(this).css('border-top-width')); console.log($(this).css('border-left-width')); $(this).dequeue(); });
but looking apply after class added use values positon correctly not jumping.
the css being applied , reflected, know updating , not being overridden style.
the jquery version using 1.10.2 jquery migrate v1.2.1 , using jquery ui.
try this:
var iframe_content = ($.browser.msie ? $('#contentframe').get(0).contentwindow.document) : $('#contentframe').get(0).contentdocument)); var obj = iframe_content.find('#someobj'); obj.queue(function() { /** check border width here **/ }); obj.addclass('testborder').dequeue(); /* last .dequeue() may not necessary */
Comments
Post a Comment