Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Scrollable DIV/IFRAME with dynamic PHP Content

Posted on 2010-09-13
6
Medium Priority
?
354 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:Gurvinder Pal Singh
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

783 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