Link to home
Start Free TrialLog in
Avatar of TechTremor
TechTremor

asked on

Scrollable DIV/IFRAME with dynamic PHP Content

I'm generally not wild about using "frames" however I'm creating a dynamic tournament bracket and if the system exceeds 32+ entrants it easily overflows the page.

I've seen some sites using a div that allows scrolling left to right. (As well as click drag like google maps). Again, this is using a DIV and not an iframe. I like this approach better because all the content is generated on one page. There is no need to pass variables to a embedded page in a iframe src.

I need a window that is maybe 600px wide and 450-500px tall that will allow me to inlay generated tournament bracket. I'm not a javascript guru and from what I understand this is what it's going to take.

My question is does anyone know of any classes, frameworks, or code that could accomplish something like this? I'm open to anything, just curious what the experts think would work best.
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

for making the content scrollable, you need to
1) give a specific height/width
2) set overflow property to scroll

div, iframe
{
  width: 100px;
  height: 100px;
  overflow: scroll;
}
http://www.w3schools.com/Css/pr_pos_overflow.asp
Avatar of Kevin Aleshire
Kevin Aleshire

Div's with scrollbars are pretty simple.
Check the code and let me know if this is what your talking about wanting.
<div style="width:600px; height:500px; overflow:auto;">
    generated content goes here
</div>

Open in new window

Avatar of TechTremor

ASKER

In my experience with overflow:auto; that just scrolls vertically.

In the event of the brackets it goes mainly left to right. If I set a max width of 600 and the "bracket" pushes out past that it typically will push the last "round" down to the bottom of the bracketing. Much like a float:right/left does when the page gets to small. Which I dont want it to do.

Is there a fix for this?
testing here i get a vertical and horozontal scroll bar.
do you have an example of what your bracket code looks like?
Yup just got it myself. I added "sub" div that set the width and that pushed it into horizontal scrolling. Perfect.

Now, is there any frameworks to allow for click and drag style scrolling?
ASKER CERTIFIED SOLUTION
Avatar of Kevin Aleshire
Kevin Aleshire

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial