- Create Account

Load in scroller from other div

Forums > DHTML Scroller > Load in scroller from other div
Author
Message

1) Charlot Group: Guests
IP: 70.81.--.--
Hello Angus.

I have a problem with my site and I am sure that you have the answer.

In my site, I have the scroller and anoter div besides it. This other div contains a <object> tag to bring in a menu (another .html file):

This is a samle of the page that contains the scroller.

<html>
<head>

<script language="javascript" type="text/javascript"><!--
function loader_news()
{
document.getElementById('menu').innerHTML="<object border='0' type='text/html' data='news/menu_news.html' width='144px' height='323px' <param name='bgcolor' value='#000000' /> />";
}
//--></script>

The scroller script, etc...
</head>

<body>
A .swf that loads function loader_news()
The scroller script, etc...

<div id="menu" style="position: absolute; top: 206px; left: 145px; width: 144px; z-index: 80"></div>

</body>
</html>

And I tried, in this menu (news/menu_news.html'), to load with a <a target="content"> but it does not work. It loads in another window. I was wondering what am I doing wrong?

another solution would be to put the scroller into a frame or a div. Would this cause problem with its functioning? To tell you the truth, I would prefer to solve the first problem instead of putting more divs or frames...

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 125.238.--.--
Putting the scroller in an IFRAME defeats the point, you might as well just use an IFRAME to begin with. In fact that is probably a better idea :).

As  for your snippet, you have the <param> *inside* the <object /> which is a no-no, make it <object><param /></object> and things should work OK. That's not really a problem with the scroller script though. Besides, you could always just put the <object> straight inside the <div> where it is supposed to be to begin with?

Do consider simplifying your site though. By the sounds of it you have a .SWF that calls JavaScript that embeds an object that inserts your navigation that might well be another JavaScript. Consider how a search engine or blind user is going to access it -- at the moment they would have great difficulty!

Good luck - Angus.

3) Charlot Group: Guests
IP: 70.81.--.--
You were right, Angus.

I did what you suggested, I simplified the site and now it works better, smoother and quicker. And it is not so complicated to modify!

The structure of the site turned out to be really complex because the site had add-ons over add-ons... but I remade it simpler and it runs smoothly. I guess we have to put new wine in new urns. Let that be a lesson for me.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.