Dears,
i was trying the width method whats get the width if the css property
width was declared or inherited.
but i was looking to get the exact width of the div, while not
specifying it in the CSS Style Properties.
as in the Width Jquery Documentation Example:
http://code.jquery.com/jquery-latest.js";>
$(document).ready(function(){
function showWidth(ele, w) {
$("div").text("The width for the " + ele +
" is " + w + "px.");
}
$("#getp").click(function () {
showWidth("paragraph", $("p").width());
});
$("#getd").click(function () {
showWidth("document", $(document).width());
});
$("#getw").click(function () {
showWidth("window", $(window).width());
});
});
body { background:yellow; }
button { font-size:12px; margin:2px; }
p { border:1px red solid; }
div { color:red; font-weight:bold; }
Get Paragraph Width
Get Document Width
Get Window Width
Sample paragraph to test width
I remove the width of the p tag from style.
i got the width value of the p tag equals to the Document Width and
Window Width.
while i need to get the exact width size of the content of the p tag
"in that case text".
get the width of the text included in the p tag.
Please, help me in that issue.
Thanks,
Shenouda Bertel