Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Scrollable DIV/IFRAME with dynamic PHP Content

Posted on 2010-09-13
6
Medium Priority
?
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

722 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