views:

106

answers:

2

Want to have vertical scroll bar if content is more than expected in popwindow...

I have a snippet to display the popwindow on click of a button which is given below: window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150,overflow-x:hidden')

with this, i am not able to have th vertical scrollbar if i have the more than expected content in it, How can i get the vertical scroll bar display byitself whenever needed?

A: 

,scrollbars=no must be ,scrollbars=yes

test it here: http://jsfiddle.net/yFRf2/

meo
@meo Not Working
OM The Eternity
meo
+1  A: 

The reason you're not getting a scrollbar, is because you're specifying scrollbars=no in the window options.

window.open(url,
'popupWindow',
'toolbar=no,location=no,directories=no,status=no,menubar=no,**scrollbars=no**,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150,overflow-x:hidden'
);

Remove the instruction in the opening code, or replace it with scrollbars=yes and it should work as you want it to. For further info, read docs for window.open.

See a demo at http://nikc.kapsi.fi/dev/html/misc/openpopup.html

nikc
I removed it But it is still not working...
OM The Eternity
Try replacing it, rather than removing it. Can you supply a URL to the problematic page in question?
nikc
you have to repace it with `scrollbars=yes` you can test it in the example i have posted
meo
I tried with scrollbars=yes but its still not working
OM The Eternity
How about that URL? There are very few psychic debuggers on SO.
nikc
OM The Eternity
Well that's all fun and fine. But to be of any use (to us), the URL should point to a server on the internet, and not in your intranet/localhost. And it should be the page opening the popup, rather than the content of the popup.
nikc
I dont get it what u mean exactly, but i have tried with all options available. and given by u
OM The Eternity
I realize you have tried what I (and others) have instructed you. But in order for us to be able to help you further, I would need to see your implementation, or at the very least a dummy mockup version of it.
nikc
I added a link to a demo page. Perhaps that can help you on your way.
nikc
What I am doing is using a button onClick attribute, in which i call a function popWindow with required parameter, and the above given javascript function is called inside it.this is how i make it happen
OM The Eternity
I saw ur example thats what I want and I am not getting it...
OM The Eternity
Your implementation depends on a number of variables. Mainly, the script opening the popup, the contents of the popup, the markup of the contents of the popup and the styling of the markup in the popup. To be able to give a definitive answer which one of these is giving you grief, I would need to see your implementation. Now that I can't see it, I can't give you that. Try removing all variables from the equation, and then return them one by one, when you have a working implementation. Standard procedure of elimination in debugging.
nikc