Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
138
rated 0 times [  141] [ 3]  / answers: 1 / hits: 48388  / 11 Years ago, wed, may 29, 2013, 12:00:00

I have a function that pops up window in the center and I want it to have a vertical scrollbar.



function popUpCal()
{
var url = calendar_flight_maint.php;
var width = 700;
var height = 600;
var left = parseInt((screen.availWidth/2) - (width/2));
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = width= + width + ,height= + height + ,status,resizable,left= + left + ,top= + top + screenX= + left + ,screenY= + top;
window.open(url, subWind, windowFeatures, POS, toolbar=no, scrollbars=1);
}


I have tried scrollbars=yes, scrollbars=auto, scrollbars=1 but the scrollbars still aren't appearing. Is there something wrong with my code? I'm using Firefox 21.0 and I've already tested it in IE 8. What seems to be the problem?


More From » scrollbar

 Answers
4

As seen in the specs for window.open, your parameters are wrong.
Try this:



function popUpCal()
{
var url = calendar_flight_maint.php;
var width = 700;
var height = 600;
var left = parseInt((screen.availWidth/2) - (width/2));
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = width= + width + ,height= + height +
,status,resizable,left= + left + ,top= + top +
screenX= + left + ,screenY= + top + ,scrollbars=yes;

window.open(url, subWind, windowFeatures, POS);
}


Here is a jsFiddle


[#77956] Tuesday, May 28, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
paulinap

Total Points: 346
Total Questions: 86
Total Answers: 97

Location: Dominican Republic
Member since Sun, Sep 4, 2022
2 Years ago
;