Solved

Scrollable DIV/IFRAME with dynamic PHP Content

Posted on 2010-09-13
6
343 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:TechTremor
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33666211
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
0
 
LVL 3

Expert Comment

by:Kevin Aleshire
ID: 33666293
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

0
 

Author Comment

by:TechTremor
ID: 33666593
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?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:Kevin Aleshire
ID: 33666634
testing here i get a vertical and horozontal scroll bar.
do you have an example of what your bracket code looks like?
0
 

Author Comment

by:TechTremor
ID: 33666662
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?
0
 
LVL 3

Accepted Solution

by:
Kevin Aleshire earned 500 total points
ID: 33666737
If that's your ultimate goal, i don't think you'll need the scrollbars at all.
The Drag-and-Drop Library for Google-Web-Toolkit (GWT) is probably what you want.  I've never implmented it myself, but it should help you accomplish what your looking to do.

http://code.google.com/p/gwt-dnd/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now