Bug Tracker

Opened 10 years ago

Closed 9 years ago

#6456 closed bug (worksforme)

Div border will affect the boxModel

Reported by: abgne.tw Owned by: abgne.tw
Priority: undecided Milestone: 1.4.2
Component: core Version: 1.3
Keywords: Cc:
Blocked by: Blocking:

Description

When using css to set div's border will affect the judgments boxModel. But not this problem in 1.2.6. Here is a simple example:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="zh-tw"> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script> <style type="text/css">

div {

height: 2000px; border: solid 1px red; /* If you remove the border settings will be moved to the right place */

}

</style> <script type="text/javascript">

$(function(){

$("a").click(function(){

move to h5's location but.... $("html, body").scrollTop($("h5").offset().top);

/* If you remove the border settings will be moved to the right place */

return false;

});

});

</script> </head>

<body>

<h4>H4</h4> <h5>H5</h5> <div></div> <a href="#">Click</a>

</body> </html>

Attachments (1)

20100418border.html (998 bytes) - added by abgne.tw 10 years ago.
sample

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by abgne.tw

Attachment: 20100418border.html added

sample

comment:1 Changed 10 years ago by abgne.tw

Sorry, the test environment is in ie6.

comment:2 Changed 9 years ago by Rick Waldron

Owner: set to abgne.tw
Priority: undecided
Status: newpending

Please provide a reduced jsFiddle test case, thanks!

Additionally, test against the jQuery 0 GIT version to ensure the issue still exists.

comment:3 Changed 9 years ago by Rick Waldron

Keywords: needsreview added

comment:4 Changed 9 years ago by abgne.tw

Status: pendingnew

test case, plz use ie

http://jsfiddle.net/ee3bZ/7/

comment:5 Changed 9 years ago by dmethvin

Keywords: needsreview removed
Resolution: worksforme
Status: newclosed

http://jsfiddle.net/dmethvin/kfE9e/1/ This one works fine in IE8. Your example is using a non-specific "div" selector and is probably catching some other element injected into the document.

Note: See TracTickets for help on using tickets.