/    Sign up×
Community /Pin to ProfileBookmark

Scrolling Div’s

Here is my code:

[CODE]<div style=”border : solid 2px #ff0000; background : #000000; color : #ffffff; padding : 4px; width : 200px; height : 50px; overflow : auto; “>
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10<br />
</div>[/CODE]

It works fine like that but I was wundering if it was possible to have another page in the scrolling div instead of just text. I was told once that you could use a scrolling div and it would work just like an Iframe. I’m just not sure how to make it so there is an external file you scroll inside the div? Please help. Thanks. ?

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@Da_WarriahAug 05.2003 — well if your file is .php, then just do something like this:

<div style="border : solid 2px #ff0000; background : #000000; color : #ffffff; padding : 4px; width : 200px; height : 50px; overflow : auto; ">

<?php include "externalfile.php"; ?>

</div>

that should do it...?
Copy linkTweet thisAlerts:
@JickauthorAug 05.2003 — One more thing! How do I get a link to open up in that div? I have some links on my page that used to have a target to open links in the Iframe but now they don't work any more after I changed my Iframe to a div so how could I set it up so when the user clicks a link it will replace the page thats in the div with the page that the link goes to? So basicly it's the same idea as the Iframe but in a div! Thanks. ?
Copy linkTweet thisAlerts:
@JickauthorAug 05.2003 — Well I spent the better part of last night and this morning trying to figure out how to make this script (which I found at the link you gave me) work with my page:
[CODE]<div id="mydiv" style="border:1px solid">
<?PHP
if (!isset($_GET["file"])) {
$include = "divinclude/default.php";
}
else {
$include = $_GET["file"];
}
include("$include");
?>[/CODE]

Could you help me out here? I need it so links on my main page will open up in the div. Basicly it's just acting like an Iframe but only it's really a Div! ?
Copy linkTweet thisAlerts:
@Da_WarriahAug 05.2003 — i dont think you want the quotes...try this instead:

include ($include);

or even simpler:

include $include;
Copy linkTweet thisAlerts:
@JickauthorAug 05.2003 — Can you go here a tell me what I did wrong here?

[URL]http://kd7pyo.infinitypages.com/test/test/divinclude.php[/URL]

Here is my code:
[code=php]<div id="mydiv" style="border:1px solid"><br/><center>This is page one</center><br/></div>

<?PHP
if (!isset($_GET["file"])) {
$include = "divinclude.php";
}
else {
$include = $_GET["file"];
}
include("$include");
?>

<a href="divinclude.php">Show default page</a> | <a href="divinclude.php?file=home.php">Show include one</a> | <a href="divinclude.php?file=index.php">Show include two</a>

</div>[/code]

I'm having lots of troble with this so could you fix the code and then repost it please. I'll even take a different code. All I'm tryin to do is to get my links to open up in my div. Thanks.
Copy linkTweet thisAlerts:
@Da_WarriahAug 05.2003 — try something like this:

[code=php]<div id="mydiv" style="border:1px solid"><br/><center>This is page one</center><br/></div>

<?PHP
if (isset($_GET["file"])) {
$include = $_GET["file"];
}

include "$include.php";
?>

<a href="divinclude.php">Show default page</a> | <a href="divinclude.php?file=home">Show include one</a> | <a href="divinclude.php?file=index">Show include two</a>

</div>[/code]


it appears that this code is on "divinclude.php"...in that case, you dont want it including itself when the $file variable isnt set...so that should work out a bit better for you...
Copy linkTweet thisAlerts:
@JickauthorAug 05.2003 — I don't think my idea is getting accrossed exactally as I planed it. Maybe I can show you better than I can tell you. Go here and look at the page and the source for the page.

[URL]http://kd7pyo.infinitypages.com/test/test/[/URL]

You will notice there is a white part where my main content goes. That part used to be an Iframe but now I changed it to a Div. It is a scrolling div. If you look above the white main content area you will see some links. I need the links to open up in the div. They used to open up in the Iframe but now I'm using a div so I need to do it differently. The only thing I have been trying to do is get it so those links open up in the main content area. Hope I explained it better now. Thanks. ?
Copy linkTweet thisAlerts:
@Dragons_BaneAug 07.2003 — I went to your links, and Its opening the sub pages in a new window... now i'm using Mozilla 1.4 browser, not IE, you may want to make sure that it works in both since I know personally alot of people that use Netscape/Mozilla (same thing really) and not IE.
×

Success!

Help @Jick spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...