jquery - How can I expand a div to compensate for removing the bordering div's margin? -
jquery - How can I expand a div to compensate for removing the bordering div's margin? -
i'm using bootstrap's responsive grid layout. need adjust 1 spot on page there's no margin between 2 columns; left column has bottom border need bring right left border of right column.
how can expand div compensate removing right-bordering div's left margin?
things i've been able do:
i'm able dynamically set height of left div drop bottom border want it:$('#indented_block .border-bottom').height( $('#indented_block').height()-3 ); i'm able determine original width of left div: $('#indented_block .border-bottom').width() i'm able determine left-margin of right div: $('#indented_block .border-side').css('margin-left'); i'm able set left-margin of right div: $('#indented_block .border-side').css('margin-left',0); i'm not able utilize jquery .width() method add together original width left-margin: $('#indented_block .border-bottom').width( $('#indented_block .border-bottom').width()+$('#indented_block .border-side').css('margin-left')); rather, i'm not able accurately add together values (for reason above line sets width width of screen).
i've created jsfiddle relevant html, js , css.
in case, difference between $('#indented_block .border-side')'s .outerwidth(true) , .outerwidth(true) left-margin in unit can used .width().
so fixed using jquery:
var margin_gap=math.floor( $('#indented_text').outerwidth(true)-$('#indented_text').outerwidth() ); $('#indented_block .border-bottom').height( $('#indented_block').height()-3 ).width( $('#indented_block .border-bottom').width()+margin_gap ); $('#indented_block .border-side').css('margin-left',0); see this working example.
jquery css twitter-bootstrap
Comments
Post a Comment