PDA

View Full Version : Resolved IFRAME Autoscroll



jasona93
01-05-2009, 10:03 PM
1) Script Title: IFRAME Scroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm

3) Describe problem: I have a client who wishes to have an Excel document display on a webpage, scrolling vertically and looping. I have saved the Excel file as a web page, and named it external.htm as required by the provided scroll.html code:



<script type="text/javascript">

/***********************************************
* IFRAME Scroller script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//specify path to your external page:
var iframesrc="external.htm"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="1200px" height="400px"

marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1"

scrolling="no"></iframe>')

</script>

When I open scroll.html, the page opens, but does not scroll. I have tried the obvious step of changing scrolling="yes", with the same result.

I did manage to find code to make the source file itself scroll, but I would rather not have my client have to paste that code in every day when editing the source file. The client would just like to edit the source file when necessary, re-save it, and have the scroll.html file successfully reference and scroll the source file.

The instruction for Customizing the Script reads as follows: "First and foremost, customize the variables within the code of Step 1. Then to edit the scroller's content, open up external.htm using any text editor, and add your content in between the HTML comments. You may also configure the scroller's speed by changing the variable "scrollspeed" inside the script that follows." However, there is no script that follows.

Is there some other string of code that must be added to the scroll.html file to accomplish my goal? Thank you in advance.

Snookerman
01-05-2009, 10:13 PM
The script that follows is external.htm (http://www.dynamicdrive.com/dynamicindex2/external.htm) that follows step 1.

jasona93
01-05-2009, 10:45 PM
Thanks Snookerman...that worked, obviously it is running the canned content that is between the lines <!-- ADD YOUR SCROLLER CONTENT INSIDE HERE --> and <!-- END SCROLLER CONTENT -->.

This may be a dumb newbie question, but I'm so new to this, and my client will be even 'newer' so I'm trying to have this solution be as low maintenance as possible.

I can certainly resave my source excel file as an html, open it in a text editor, and paste the content between the above prompts. My question, is whether there is a short way for my end user to do it - such as simply referencing the filepath and the .html file in question, and entering that between the above prompts. I can certainly see potential is a non-technical end user messing this up.

Snookerman
01-11-2009, 12:30 PM
You're welcome, glad to help! You can go to your first post in this thread, click http://www.dynamicdrive.com/forums/images/buttons/edit.gif then click Go Advanced and add the Resolved prefix to the thread title. This will let other users know the problem has been solved.
Regarding your other question, if I understand you correctly, I think you will need a server-side code for that, try starting a thread in the PHP forum (http://www.dynamicdrive.com/forums/forumdisplay.php?f=11).

Good luck!