Skip to main content

Bug Tracker

Side navigation

#6456 closed bug (worksforme)

Opened April 18, 2010 12:34PM UTC

Closed November 11, 2010 02:02AM UTC

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)
Change History (5)

Changed April 18, 2010 12:49PM UTC by abgne.tw comment:1

Sorry, the test environment is in ie6.

Changed October 29, 2010 04:54PM UTC by rwaldron comment:2

owner: → 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.

Changed October 29, 2010 05:03PM UTC by rwaldron comment:3

keywords: → needsreview

Changed November 10, 2010 08:37AM UTC by abgne.tw comment:4

status: pendingnew

test case, plz use ie

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

Changed November 11, 2010 02:02AM UTC by dmethvin comment:5

keywords: needsreview
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.