open new window popup using javascript


<script>
function popupW()

{ window.open(‘http://google.com&#8217;,’banco’,’toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no’); return true;

}

popupW();
</script>

Advertisements

Use jQuery to get the width of an element in percent


Use jQuery to get the width of an element in percent or pixels, based on what the developer specified with CSS

var width = $('#someElt').width();
var parentWidth = $('#someElt').offsetParent().width();
var percent = 100*width/parentWidth;

or you can use

var width = ( 100 * parseFloat($('.largeField').css('width')) / parseFloat($('.largeField').parent().css('width')) ) + '%'