Solved

Scrollable DIV/IFRAME with dynamic PHP Content

Posted on 2010-09-13
6
341 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

743 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

11 Experts available now in Live!

Get 1:1 Help Now