Bug Tracker

Modify

Ticket #6456 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

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

Change History

Changed 3 years ago by abgne.tw

sample

comment:1 Changed 3 years ago by abgne.tw

Sorry, the test environment is in ie6.

comment:2 Changed 3 years ago by rwaldron

  • Owner set to abgne.tw
  • Priority set to undecided
  • Status changed from new to pending

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 3 years ago by rwaldron

  • Keywords needsreview added

comment:4 Changed 3 years ago by abgne.tw

  • Status changed from pending to new

test case, plz use ie

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

comment:5 Changed 3 years ago by dmethvin

  • Keywords needsreview removed
  • Status changed from new to closed
  • Resolution set to worksforme

 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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.