Jump to content

Adding External Html Page To <div>


Web Weenie
 Share

Recommended Posts

Sorry for the repost from HTML forums... I have a div that uses a js script to vertically scroll it's contents. I've worked out all the code except for adding an external html page to the div. Can someone point the way for me, I'm lost.here are some additional issues... I need to sandwich the external HTMl between other html. A small block of html on top and bottom. And...I need to load different external html pages selected from a popup menu.So far I'm unable to get any external page to load, resulting in a blank area.I also need to insert the current date into the top block of html. The top and bottom bits of HTML are static except the date.As much detail as possible would be appreciated. I'm bumbling my way through this and I need all the help I can get. TIA

Link to comment
Share on other sites

Unless you're bent on using a div, if you want it to be as easy as possible then an iframe is designed for what you're trying to do. You can style an iframe element like you would a div, and it has native support for loading external content. If you give it an ID then you could have a select element with other page URLs in it which could use a Javascript function to change the source of the iframe to a different file. If you wanted to use a div instead of an iframe then you would need to duplicate the entire external load process yourself using Javascript. Or, if you want to really get into Javascript, then you could also learn a library like jQuery or ExtJS which you could use to load the content.

Link to comment
Share on other sites

Unless you're bent on using a div, if you want it to be as easy as possible then an iframe is designed for what you're trying to do. You can style an iframe element like you would a div, and it has native support for loading external content. If you give it an ID then you could have a select element with other page URLs in it which could use a Javascript function to change the source of the iframe to a different file. If you wanted to use a div instead of an iframe then you would need to duplicate the entire external load process yourself using Javascript. Or, if you want to really get into Javascript, then you could also learn a library like jQuery or ExtJS which you could use to load the content.
The voice in the back of head was telling me I need to use iframes. I did a cursory search on scrolling an iframe, but other than the scrollbar attribute i didn't see anything... Maybe I need to dig deeper.I have a vertical scroller pane using a div and javascript. Can I convert this to iframe and use scroll='no' for the iframe?I have a desktop application that generates about 250 (and growing) html pages and uploads to a web server. It also generates about 50 lists of links to the pages with a small description and dates as html pages. I need to scroll this list of links in my vertical scroller.I agree that iframes will be easy to load these lists into, but can js auto scroll it. I don't want to give up the real estate for the scrollbars. I have the js working now for the scroller and also have a control to speed up or slow down the scroll rate working.I'll look into jQuery and ExtJS tp see what they have to offer, but if you or anyone else has any ideas or solutions, please chime in. I need to get this up and running asap.Thanks for the comments...
Link to comment
Share on other sites

You should be able to use CSS to remove scrollbars by setting the overflow property to "hide". e.g.:<iframe style="overflow: hide;" ...I think in order to scroll the contents of the iframe you'll need to either set the scrollTop property of the iframe (which I'm not sure how it will work with overflow set to hide), or possibly the scrollTop or top properties of the document in the iframe.

Link to comment
Share on other sites

I've been scouring then inter-webs for a solution for this. I've found an tried several examples and only found one that is acceptable to me and that I can get working. I've also made a small mod which allows the user to slow down or speed up the pause delay.This is the example: http://www.dynamicdrive.com/dynamicindex18/gajaxpausescroller.htm. It has 2 external js scripts and a one inline script, plus a bit of CSS.I need help in making another mod. I have a form popup menulist that contains several other RSS feeds. Each option item contains a URL. I need a way to kill the current RSS running in the scroller and switch to the user selected RSS feed without a page reload. One or both of the js files will need to modded to do this I'm sure but maybe some js guru can find a solution as this is all beyond me.Please help and TIA...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...