Web Weenie Posted February 24, 2010 Share Posted February 24, 2010 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 More sharing options...
justsomeguy Posted February 24, 2010 Share Posted February 24, 2010 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 More sharing options...
Web Weenie Posted February 24, 2010 Author Share Posted February 24, 2010 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 More sharing options...
justsomeguy Posted February 24, 2010 Share Posted February 24, 2010 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 More sharing options...
Synook Posted February 26, 2010 Share Posted February 26, 2010 Note that the value for the CSS overflow property is actually hidden. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 26, 2010 Share Posted February 26, 2010 Oh right, I didn't look that up before I wrote. See what happens when you don't use a reference, kids? Link to comment Share on other sites More sharing options...
Web Weenie Posted March 2, 2010 Author Share Posted March 2, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.